Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

improved use of docker_tag #27

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ build:
@echo -e "\033[32mSuccessfully built \033[1mstackstorm/st2:${DOCKER_TAG}\033[0m\033[32m common Docker image with StackStorm version \033[1m${ST2_VERSION}\033[0m"
@set -e; \
for component in st2*; do \
echo -e "\033[32mStarting build of \033[1mstackstorm/$$component:${DOCKER_TAG}\033[0m\033[32m Docker image for StackStorm version \033[1m${ST2_VERSION}\033[0m"; \
docker build \
--no-cache \
--build-arg ST2_VERSION=${ST2_VERSION} \
--build-arg DOCKER_TAG=${DOCKER_TAG} \
--tag stackstorm/$$component:${DOCKER_TAG} \
$$component/; \
echo -e "\033[32mSuccessfully built \033[1mstackstorm/$$component:${DOCKER_TAG}\033[0m\033[32m Docker image for StackStorm version \033[1m${ST2_VERSION}\033[0m"; \
Expand Down
3 changes: 2 additions & 1 deletion st2actionrunner/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG ST2_VERSION
FROM stackstorm/st2:${ST2_VERSION}
ARG DOCKER_TAG
FROM stackstorm/st2:${DOCKER_TAG}
Copy link
Member

Choose a reason for hiding this comment

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

If we add new DOCKER_TAG into child Dockerfiles, looks like we don't need ST2_VERSION in them anymore and that would be just a var rename. Am I missing something?

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

st2web and st2chatops (and base, though that's out of scope) rely on ST2_VERSION in their build for running scripts and packages. The others could just be a variable rename, but it would require some additional logic in the Makefile.

RUN if [ "${ST2_VERSION#*dev}" != "${ST2_VERSION}" ]; then \
& apt-get install -y st2web=${ST2_VERSION}-* \
&& apt-get install -y st2chatops=${ST2_VERSION}-* \

Copy link
Member

Choose a reason for hiding this comment

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

I see now, thanks!

So let's then rename var that won't require any additional Makefile changes?
st2 services like st2actionrunner, st2sensorcontainer... and so on.

So we won't have unused ST2_VERSION var in the Dockerfiles.

LABEL com.stackstorm.component="st2actionrunner"

# Install utils used by st2 'linux' pack, part of StackStorm core
Expand Down
3 changes: 2 additions & 1 deletion st2api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG ST2_VERSION
FROM stackstorm/st2:${ST2_VERSION}
ARG DOCKER_TAG
FROM stackstorm/st2:${DOCKER_TAG}
LABEL com.stackstorm.component="st2api"

USER st2
Expand Down
3 changes: 2 additions & 1 deletion st2auth/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG ST2_VERSION
FROM stackstorm/st2:${ST2_VERSION}
ARG DOCKER_TAG
FROM stackstorm/st2:${DOCKER_TAG}
LABEL com.stackstorm.component="st2auth"

USER st2
Expand Down
3 changes: 2 additions & 1 deletion st2garbagecollector/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG ST2_VERSION
FROM stackstorm/st2:${ST2_VERSION}
ARG DOCKER_TAG
FROM stackstorm/st2:${DOCKER_TAG}
LABEL com.stackstorm.component="st2garbagecollector"

USER st2
Expand Down
3 changes: 2 additions & 1 deletion st2notifier/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG ST2_VERSION
FROM stackstorm/st2:${ST2_VERSION}
ARG DOCKER_TAG
FROM stackstorm/st2:${DOCKER_TAG}
LABEL com.stackstorm.component="st2notifier"

USER st2
Expand Down
3 changes: 2 additions & 1 deletion st2resultstracker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG ST2_VERSION
FROM stackstorm/st2:${ST2_VERSION}
ARG DOCKER_TAG
FROM stackstorm/st2:${DOCKER_TAG}
LABEL com.stackstorm.component="st2resultstracker"

USER st2
Expand Down
3 changes: 2 additions & 1 deletion st2rulesengine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG ST2_VERSION
FROM stackstorm/st2:${ST2_VERSION}
ARG DOCKER_TAG
FROM stackstorm/st2:${DOCKER_TAG}
LABEL com.stackstorm.component="st2rulesengine"

USER st2
Expand Down
3 changes: 2 additions & 1 deletion st2scheduler/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG ST2_VERSION
FROM stackstorm/st2:${ST2_VERSION}
ARG DOCKER_TAG
FROM stackstorm/st2:${DOCKER_TAG}
LABEL com.stackstorm.component="st2scheduler"

USER st2
Expand Down
3 changes: 2 additions & 1 deletion st2sensorcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG ST2_VERSION
FROM stackstorm/st2:${ST2_VERSION}
ARG DOCKER_TAG
FROM stackstorm/st2:${DOCKER_TAG}
LABEL com.stackstorm.component="st2sensorcontainer"

USER st2
Expand Down
3 changes: 2 additions & 1 deletion st2stream/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG ST2_VERSION
FROM stackstorm/st2:${ST2_VERSION}
ARG DOCKER_TAG
FROM stackstorm/st2:${DOCKER_TAG}
LABEL com.stackstorm.component="st2stream"

USER st2
Expand Down
3 changes: 2 additions & 1 deletion st2timersengine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG ST2_VERSION
FROM stackstorm/st2:${ST2_VERSION}
ARG DOCKER_TAG
FROM stackstorm/st2:${DOCKER_TAG}
LABEL com.stackstorm.component="st2timersengine"

USER st2
Expand Down
3 changes: 2 additions & 1 deletion st2workflowengine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG ST2_VERSION
FROM stackstorm/st2:${ST2_VERSION}
ARG DOCKER_TAG
FROM stackstorm/st2:${DOCKER_TAG}
LABEL com.stackstorm.component="st2workflowengine"

USER st2
Expand Down