Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Parameterize Dockerfiles for Open edX releases #3864

Merged
merged 1 commit into from
May 12, 2017

Conversation

nedbat
Copy link
Contributor

@nedbat nedbat commented May 10, 2017

Configuration Pull Request

Add some parameterization to the Dockerfiles so we can make images for Open edX releases. (Much more is needed to complete that work, this is a start).

This provides for choosing a different branch other than master ($OPENEDX_RELEASE), and for adding a component to the image names ($IMAGE_PREFIX).

The IMAGE_PREFIX would be empty for master builds, so the images will be named as they are today: "edxops/edxapp:latest". For Ficus, IMAGE_PREFIX would be "ficus/", so the image would be "edxops/ficus/edxapp:latest".

These files use a feature newly available in Docker 17.05: the use of ARGS in the FROM line.

Make sure that the following steps are done before merging:

  • A DevOps team member has approved the PR.
  • Are you adding any new default values that need to be overridden when this change goes live? If so:
    • Update the appropriate internal repo (be sure to update for all our environments)
    • If you are updating a secure value rather than an internal one, file a DEVOPS ticket with details.
    • Add an entry to the CHANGELOG.
  • Have you performed the proper testing specified on the Ops Ansible Testing Checklist?

@nedbat
Copy link
Contributor Author

nedbat commented May 10, 2017

@clintonb @gsong @feanil opinions?

@@ -8,7 +8,8 @@
# with the currently checked-out configuration repo.


FROM edxops/xenial-common:latest
ARG IMAGE_PREFIX
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the default for this just an empty string? What are other valid values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it defaults to empty string. I'm not sure the best way to indicate that. It works now if not provided.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a comment just so that clear. Also is there anything we can say about how to figure out what are valid values for this arg? It's fine if there isn't but would be useful to put something here if there is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are some example values?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clintonb I believe the idea is to have Open edX specific prefixes, e.g. ficus-.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have explained more, sorry. Master would make "edxops/edxapp:latest", and Ficus would make "edxops/ficus/edxapp:latest". $IMAGE_PREFIX would be "ficus/"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the description to the top of the PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nedbat any reason not to put that info in this file or a README under the docker/build directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added details to the docker/README.md (i'll convert to .rst in a follow-on).

Copy link
Contributor

@clintonb clintonb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems right. I'd like to better understand the naming scheme.

@@ -8,7 +8,8 @@
# with the currently checked-out configuration repo.


FROM edxops/xenial-common:latest
ARG IMAGE_PREFIX
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are some example values?

@@ -1,5 +1,5 @@
FROM ubuntu:xenial
MAINTAINER edxops
MAINTAINER edxops
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the maintainer was supposed to be an email address, but I can't find where I read that, and I don't know what email we would use. I'll leave this to a following PR.

@@ -10,7 +10,8 @@ ENV LANG C.UTF-8

ENV ANSIBLE_REPO="https://github.com/edx/ansible"
ENV CONFIGURATION_REPO="https://github.com/edx/configuration.git"
ENV CONFIGURATION_VERSION="master"
ARG OPENEDX_RELEASE=master
ENV CONFIGURATION_VERSION="$OPENEDX_RELEASE"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we standardize on ${var} syntax?

@gsong
Copy link
Contributor

gsong commented May 10, 2017

@clintonb @feanil It's also worth noting that the parameterized FROM instruction is a feature of edge channel Docker CE.

@nedbat nedbat force-pushed the nedbat/parameterize-dockerfiles branch from 156967e to 9c7242e Compare May 12, 2017 16:44
Copy link
Contributor Author

@nedbat nedbat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also used ${} everywhere.

@@ -8,7 +8,8 @@
# with the currently checked-out configuration repo.


FROM edxops/xenial-common:latest
ARG IMAGE_PREFIX
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added details to the docker/README.md (i'll convert to .rst in a follow-on).

@nedbat nedbat merged commit 03527b9 into master May 12, 2017
@nedbat nedbat deleted the nedbat/parameterize-dockerfiles branch May 12, 2017 18:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants