Skip to content

Commit 9663401

Browse files
committedApr 25, 2018
TE-2548 Support for building Open edX release Docker images
1 parent 2263f94 commit 9663401

File tree

16 files changed

+120
-37
lines changed

16 files changed

+120
-37
lines changed
 

‎docker/README.rst

+8-9
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,9 @@ set of make commands.
4343
Image naming
4444
************
4545

46-
Images built from master branches are named ``edxops/<service>``, for example,
47-
``edxops/edxapp``. Images built from Open edX release branches include the
48-
short release name: ``edxops/ficus/edxapp``. Both images will have a
49-
``:latest`` version.
46+
The latest images built from master branches are named ``edxops/<service>:latest``,
47+
for example, ``edxops/edxapp:latest``. Images built from Open edX release
48+
branches use an appropriate tag, such as ``edxops/edxapp:hawthorn.master``.
5049

5150
Build arguments
5251
***************
@@ -56,13 +55,13 @@ Dockerfiles make use of these build arguments:
5655
- ``OPENEDX_RELEASE`` is the release branch to use. It defaults to "master".
5756
To use an Open edX release, provide the full branch name:
5857

59-
``--build-arg OPENEDX_RELEASE=open-release/ficus.master``
58+
``--build-arg OPENEDX_RELEASE=open-release/hawthorn.master``
6059

61-
- ``IMAGE_PREFIX`` is the release branch component to add to images. It
62-
defaults to an empty string for master builds. For Open edX release, use the
63-
short name of the release, with a trailing slash:
60+
- ``BASE_IMAGE_TAG`` is the tag for the base image to build on. It
61+
defaults to "latest" for master builds. For an Open edX release, use
62+
the name of the release:
6463

65-
``--build-arg IMAGE_PREFIX=ficus/``
64+
``--build-arg BASE_IMAGE_TAG=hawthorn.master``
6665

6766
Conventions
6867
***********

‎docker/build/analytics_api/Dockerfile

+20-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
FROM edxops/xenial-common:latest
1+
# To build this Dockerfile:
2+
#
3+
# From the root of configuration:
4+
#
5+
# docker build -f docker/build/analytics_api/Dockerfile .
6+
#
7+
# This allows the dockerfile to update /edx/app/edx_ansible/edx_ansible
8+
# with the currently checked-out configuration repo.
9+
10+
ARG BASE_IMAGE_TAG=latest
11+
FROM edxops/xenial-common:${BASE_IMAGE_TAG}
212
MAINTAINER edxops
313

414
RUN apt-get update
@@ -8,7 +18,15 @@ COPY docker/build/analytics_api/ansible_overrides.yml /
818
WORKDIR /edx/app/edx_ansible/edx_ansible/docker/plays
919

1020
COPY docker/build/analytics_api/ansible_overrides.yml /
11-
RUN /edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook analytics_api.yml -i '127.0.0.1,' -c local -t "install:base,install:system-requirements,install:configuration,install:app-requirements,install:code" -e@/ansible_overrides.yml
21+
22+
ARG OPENEDX_RELEASE=master
23+
ENV OPENEDX_RELEASE=${OPENEDX_RELEASE}
24+
RUN /edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook analytics_api.yml \
25+
-i '127.0.0.1,' \
26+
-c local \
27+
-t "install:base,install:system-requirements,install:configuration,install:app-requirements,install:code" \
28+
--extra-vars="ANALYTICS_API_VERSION=${OPENEDX_RELEASE}" \
29+
--extra-vars="@/ansible_overrides.yml"
1230
WORKDIR /edx/app/
1331
CMD ["/edx/app/supervisor/venvs/supervisor/bin/supervisord", "-n", "--configuration", "/edx/app/supervisor/supervisord.conf"]
1432
EXPOSE 443 80

‎docker/build/analytics_api/ansible_overrides.yml

-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,3 @@ ANALYTICS_API_DATABASES:
1919
PASSWORD: 'password'
2020
HOST: "db.{{ DOCKER_TLD }}"
2121
PORT: '3306'
22-
23-
# Change this if you want to build a specific version of the ANALYTICS_API
24-
ANALYTICS_API_VERSION: 'master'

‎docker/build/credentials/Dockerfile

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
# This allows the dockerfile to update /edx/app/edx_ansible/edx_ansible
88
# with the currently checked-out configuration repo.
99

10-
FROM edxops/xenial-common:latest
10+
ARG BASE_IMAGE_TAG=latest
11+
FROM edxops/xenial-common:${BASE_IMAGE_TAG}
1112
MAINTAINER edxops
1213
USER root
1314
CMD ["/edx/app/supervisor/venvs/supervisor/bin/supervisord", "-n", "--configuration", "/edx/app/supervisor/supervisord.conf"]
@@ -18,9 +19,12 @@ WORKDIR /edx/app/edx_ansible/edx_ansible/docker/plays
1819
COPY docker/build/credentials/ansible_overrides.yml /
1920
COPY docker/build/devstack/ansible_overrides.yml /devstack/ansible_overrides.yml
2021

22+
ARG OPENEDX_RELEASE=master
23+
ENV OPENEDX_RELEASE=${OPENEDX_RELEASE}
2124
RUN sudo /edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook credentials.yml \
2225
-c local -i "127.0.0.1," \
2326
-t "install,assets,devstack" \
27+
--extra-vars="CREDENTIALS_VERSION=${OPENEDX_RELEASE}" \
2428
--extra-vars="@/ansible_overrides.yml" \
2529
--extra-vars="@/devstack/ansible_overrides.yml"
2630

‎docker/build/credentials/ansible_overrides.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
COMMON_GIT_PATH: 'edx'
3-
CREDENTIALS_VERSION: 'master'
43

54
COMMON_MYSQL_MIGRATE_USER: '{{ CREDENTIALS_MYSQL_USER }}'
65
COMMON_MYSQL_MIGRATE_PASS: '{{ CREDENTIALS_MYSQL_PASSWORD }}'

‎docker/build/devpi/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
# This allows the dockerfile to update /edx/app/edx_ansible/edx_ansible
88
# with the currently checked-out configuration repo.
99

10-
FROM edxops/xenial-common:latest
10+
ARG BASE_IMAGE_TAG=latest
11+
FROM edxops/xenial-common:${BASE_IMAGE_TAG}
1112
MAINTAINER edxops
1213

1314
ARG ARG_DEVPI_SERVER_VERSION=4.4.0

‎docker/build/discovery/Dockerfile

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
# This allows the dockerfile to update /edx/app/edx_ansible/edx_ansible
88
# with the currently checked-out configuration repo.
99

10-
FROM edxops/xenial-common:latest
10+
ARG BASE_IMAGE_TAG=latest
11+
FROM edxops/xenial-common:${BASE_IMAGE_TAG}
1112
MAINTAINER edxops
1213
USER root
1314
CMD ["/edx/app/supervisor/venvs/supervisor/bin/supervisord", "-n", "--configuration", "/edx/app/supervisor/supervisord.conf"]
@@ -18,9 +19,12 @@ WORKDIR /edx/app/edx_ansible/edx_ansible/docker/plays
1819
COPY docker/build/discovery/ansible_overrides.yml /
1920
COPY docker/build/devstack/ansible_overrides.yml /devstack/ansible_overrides.yml
2021

22+
ARG OPENEDX_RELEASE=master
23+
ENV OPENEDX_RELEASE=${OPENEDX_RELEASE}
2124
RUN sudo /edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook discovery.yml \
2225
-c local -i '127.0.0.1,' \
2326
-t 'install,assets,devstack' \
27+
--extra-vars="DISCOVERY_VERSION=${OPENEDX_RELEASE}" \
2428
--extra-vars="@/ansible_overrides.yml" \
2529
--extra-vars="@/devstack/ansible_overrides.yml"
2630

‎docker/build/discovery/ansible_overrides.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
COMMON_GIT_PATH: 'edx'
3-
DISCOVERY_VERSION: 'master'
43

54
COMMON_MYSQL_MIGRATE_USER: '{{ DISCOVERY_MYSQL_USER }}'
65
COMMON_MYSQL_MIGRATE_PASS: '{{ DISCOVERY_MYSQL_PASSWORD }}'

‎docker/build/ecommerce/Dockerfile

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
# This allows the dockerfile to update /edx/app/edx_ansible/edx_ansible
88
# with the currently checked-out configuration repo.
99

10-
FROM edxops/xenial-common:latest
10+
ARG BASE_IMAGE_TAG=latest
11+
FROM edxops/xenial-common:${BASE_IMAGE_TAG}
1112
MAINTAINER edxops
1213
USER root
1314
CMD ["/edx/app/supervisor/venvs/supervisor/bin/supervisord", "-n", "--configuration", "/edx/app/supervisor/supervisord.conf"]
@@ -18,9 +19,12 @@ WORKDIR /edx/app/edx_ansible/edx_ansible/docker/plays
1819
COPY docker/build/ecommerce/ansible_overrides.yml /
1920
COPY docker/build/devstack/ansible_overrides.yml /devstack/ansible_overrides.yml
2021

22+
ARG OPENEDX_RELEASE=master
23+
ENV OPENEDX_RELEASE=${OPENEDX_RELEASE}
2124
RUN sudo /edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook ecommerce.yml \
2225
-c local -i '127.0.0.1,' \
2326
-t 'install,assets,devstack' \
27+
--extra-vars="ECOMMERCE_VERSION=${OPENEDX_RELEASE}" \
2428
--extra-vars="@/ansible_overrides.yml" \
2529
--extra-vars="@/devstack/ansible_overrides.yml"
2630

‎docker/build/ecommerce/ansible_overrides.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
COMMON_GIT_PATH: 'edx'
3-
ECOMMERCE_VERSION: 'master'
43

54
COMMON_MYSQL_MIGRATE_USER: '{{ ECOMMERCE_MYSQL_USER }}'
65
COMMON_MYSQL_MIGRATE_PASS: '{{ ECOMMERCE_MYSQL_PASSWORD }}'

‎docker/build/edxapp/Dockerfile

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
#
33
# From the root of configuration:
44
#
5-
# docker build -f docker/build/edxapp/Dockerfile . -t edxops/edxapp:latest
5+
# docker build -f docker/build/edxapp/Dockerfile .
66
#
77
# This allows the dockerfile to update /edx/app/edx_ansible/edx_ansible
88
# with the currently checked-out configuration repo.
99

10-
11-
ARG IMAGE_PREFIX
12-
FROM edxops/${IMAGE_PREFIX}xenial-common:latest
10+
ARG BASE_IMAGE_TAG=latest
11+
FROM edxops/xenial-common:${BASE_IMAGE_TAG}
1312
MAINTAINER edxops
1413
USER root
1514
CMD ["/edx/app/supervisor/venvs/supervisor/bin/supervisord", "-n", "--configuration", "/edx/app/supervisor/supervisord.conf"]
@@ -26,7 +25,7 @@ ENV OPENEDX_RELEASE=${OPENEDX_RELEASE}
2625
RUN sudo /edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook edxapp.yml \
2726
-c local -i '127.0.0.1,' \
2827
-t 'install,assets,devstack' \
29-
--extra-vars=edx_platform_version=${OPENEDX_RELEASE} \
28+
--extra-vars="edx_platform_version=${OPENEDX_RELEASE}" \
3029
--extra-vars="@/ansible_overrides.yml" \
3130
--extra-vars="@/devstack.yml" \
3231
--extra-vars="@/devstack/ansible_overrides.yml" \

‎docker/build/forum/Dockerfile

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
1-
FROM edxops/xenial-common:latest
1+
# To build this Dockerfile:
2+
#
3+
# From the root of configuration:
4+
#
5+
# docker build -f docker/build/forum/Dockerfile .
6+
#
7+
# This allows the dockerfile to update /edx/app/edx_ansible/edx_ansible
8+
# with the currently checked-out configuration repo.
9+
10+
ARG BASE_IMAGE_TAG=latest
11+
FROM edxops/xenial-common:${BASE_IMAGE_TAG}
212
MAINTAINER edxops
313

414
WORKDIR /edx/app/edx_ansible/edx_ansible/docker/plays
515
ADD . /edx/app/edx_ansible/edx_ansible
616
COPY docker/build/forum/ansible_overrides.yml /
17+
18+
ARG OPENEDX_RELEASE=master
19+
ENV OPENEDX_RELEASE=${OPENEDX_RELEASE}
720
RUN /edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook forum.yml \
821
-i '127.0.0.1,' -c local \
922
-t "install:base,install:configuration,install:app-requirements,install:code" \
10-
-e@/ansible_overrides.yml
23+
--extra-vars="forum_version=${OPENEDX_RELEASE}" \
24+
--extra-vars="@/ansible_overrides.yml"
1125
WORKDIR /edx/app
1226
CMD ["/edx/app/supervisor/venvs/supervisor/bin/supervisord", "-n", "--configuration", "/edx/app/supervisor/supervisord.conf"]
1327
EXPOSE 4567

‎docker/build/insights/Dockerfile

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
1-
FROM edxops/xenial-common:latest
1+
# To build this Dockerfile:
2+
#
3+
# From the root of configuration:
4+
#
5+
# docker build -f docker/build/insights/Dockerfile .
6+
#
7+
# This allows the dockerfile to update /edx/app/edx_ansible/edx_ansible
8+
# with the currently checked-out configuration repo.
9+
10+
ARG BASE_IMAGE_TAG=latest
11+
FROM edxops/xenial-common:${BASE_IMAGE_TAG}
212
MAINTAINER edxops
313

414
ADD . /edx/app/edx_ansible/edx_ansible
515
COPY docker/build/insights/ansible_overrides.yml /
616
WORKDIR /edx/app/edx_ansible/edx_ansible/docker/plays
17+
18+
ARG OPENEDX_RELEASE=master
19+
ENV OPENEDX_RELEASE=${OPENEDX_RELEASE}
720
RUN /edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook insights.yml \
821
-i '127.0.0.1,' -c local \
922
-t "install:base,install:system-requirements,install:configuration,install:app-requirements,install:code" \
10-
-e@/ansible_overrides.yml
23+
--extra-vars="INSIGHTS_VERSION=${OPENEDX_RELEASE}" \
24+
--extra-vars="@/ansible_overrides.yml"
1125
CMD ["/edx/app/supervisor/venvs/supervisor/bin/supervisord", "-n", "--configuration", "/edx/app/supervisor/supervisord.conf"]
1226
EXPOSE 8110 18110

‎docker/build/jenkins_build/Dockerfile

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
FROM edxops/xenial-common:latest
1+
# To build this Dockerfile:
2+
#
3+
# From the root of configuration:
4+
#
5+
# docker build -f docker/build/jenkins_build/Dockerfile .
6+
#
7+
# This allows the dockerfile to update /edx/app/edx_ansible/edx_ansible
8+
# with the currently checked-out configuration repo.
9+
10+
ARG BASE_IMAGE_TAG=latest
11+
FROM edxops/xenial-common:${BASE_IMAGE_TAG}
212
MAINTAINER edxops
313

414
USER root

‎docker/build/xqueue/Dockerfile

+12-4
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
#
33
# From the root of configuration:
44
#
5-
# docker build -f docker/build/xqueue/Dockerfile . -t edxops/xqueue:latest
5+
# docker build -f docker/build/xqueue/Dockerfile .
66
#
77
# This allows the dockerfile to update /edx/app/edx_ansible/edx_ansible
88
# with the currently checked-out configuration repo.
99

10-
ARG IMAGE_PREFIX
11-
FROM edxops/${IMAGE_PREFIX}xenial-common:latest
10+
ARG BASE_IMAGE_TAG=latest
11+
FROM edxops/xenial-common:${BASE_IMAGE_TAG}
1212
MAINTAINER edxops
1313
CMD ["/edx/app/supervisor/venvs/supervisor/bin/supervisord", "-n", "--configuration", "/edx/app/supervisor/supervisord.conf"]
1414

@@ -17,6 +17,14 @@ RUN apt-get update
1717
ADD . /edx/app/edx_ansible/edx_ansible
1818
COPY docker/build/xqueue/ansible_overrides.yml /
1919
WORKDIR /edx/app/edx_ansible/edx_ansible/docker/plays
20-
RUN /edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook xqueue.yml -i '127.0.0.1,' -c local -t "install:base,install:system-requirements,install:configuration,install:app-requirements,install:code,devstack" -e@/ansible_overrides.yml
20+
21+
ARG OPENEDX_RELEASE=master
22+
ENV OPENEDX_RELEASE=${OPENEDX_RELEASE}
23+
RUN /edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook xqueue.yml \
24+
-i '127.0.0.1,' \
25+
-c local \
26+
-t "install:base,install:system-requirements,install:configuration,install:app-requirements,install:code,devstack" \
27+
--extra-vars="xqueue_version=${OPENEDX_RELEASE}" \
28+
--extra-vars="@/ansible_overrides.yml"
2129

2230
EXPOSE 18040

‎docker/build/xqwatcher/Dockerfile

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
1-
FROM edxops/trusty-common:v3
1+
# To build this Dockerfile:
2+
#
3+
# From the root of configuration:
4+
#
5+
# docker build -f docker/build/xqwatcher/Dockerfile .
6+
#
7+
# This allows the dockerfile to update /edx/app/edx_ansible/edx_ansible
8+
# with the currently checked-out configuration repo.
9+
10+
ARG BASE_IMAGE_TAG=latest
11+
FROM edxops/xenial-common:${BASE_IMAGE_TAG}
212
MAINTAINER edxops
313

414
ADD . /edx/app/edx_ansible/edx_ansible
515
COPY docker/build/xqwatcher/ansible_overrides.yml /
616
WORKDIR /edx/app/edx_ansible/edx_ansible/docker/plays
17+
18+
ARG OPENEDX_RELEASE=master
19+
ENV OPENEDX_RELEASE=${OPENEDX_RELEASE}
720
RUN /edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook xqwatcher.yml \
821
-i '127.0.0.1,' -c local \
922
-t "install:base,install:configuration,install:system-requirements,install:app-requirements,install:code" \
10-
-e@/ansible_overrides.yml
23+
--extra-vars="XQWATCHER_VERSION=${OPENEDX_RELEASE}" \
24+
--extra-vars="@/ansible_overrides.yml"
1125
WORKDIR /edx/app
1226
CMD ["/edx/app/supervisor/venvs/supervisor/bin/supervisord", "-n", "--configuration", "/edx/app/supervisor/supervisord.conf"]

0 commit comments

Comments
 (0)
Please sign in to comment.