Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

DOCKER_TAG not used by Dockerfiles #26

Open
ytjohn opened this issue Apr 30, 2020 · 3 comments
Open

DOCKER_TAG not used by Dockerfiles #26

ytjohn opened this issue Apr 30, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@ytjohn
Copy link
Contributor

ytjohn commented Apr 30, 2020

I can do a PR, but wanted to ask this as a question first. I want to build a custom st2 base image and then build the remaining st2 images from that image instead of upstream stackstorm/st2:${ST2_VERSION}

For background, I went to build the docker images myself in order to get bionic/python3.6 (see #16), which required making changes to the base image. I want to give the st2 base image and all subsequent ones a tag of "3.2.0-dev-bionic", which I can do by exporting DOCKER_TAG before running "make build".

The problem is that each Dockerfile has a line of FROM stackstorm/st2:${ST2_VERSION}. Which means they won't build from my new base image, but rather upstream base image.

My workaround is to additionally pass DOCKER_TAG into each Dockerfile and update the from line.

ARG ST2_VERSION
ARG DOCKER_TAG
FROM stackstorm/st2:${DOCKER_TAG}

Then in the Makefile:

        for component in st2*; do \
                docker build \
                        --no-cache \
                        --build-arg ST2_VERSION=${ST2_VERSION} \
                        --build-arg DOCKER_TAG=${DOCKER_TAG} \
                        --tag stackstorm/$$component:${DOCKER_TAG} \

This seems reasonable to me. If someone is needing to put a specific tag on the base, they will most likely want to build their other images from that tag. If this seems reasonable or useful to others, I will go ahead and create a PR.

@arm4b
Copy link
Member

arm4b commented Apr 30, 2020

That makes sense and looks like fairly minimal change so I'm 👍

BTW we're going to switch to Ubuntu Bionic for the Dockerfiles really soon. So your tests and feedback in #16 would be very helpful.

@arm4b arm4b added the enhancement New feature or request label Apr 30, 2020
@winem
Copy link
Contributor

winem commented May 23, 2020

Can't this be closed as the PR was already merged? Or is there any remaining ToDo?

@arm4b
Copy link
Member

arm4b commented May 23, 2020

WDYT @ytjohn?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants