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

ci/use local dockerfile #2

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

mirestrepo
Copy link
Member

Use local Dockerfile instead of generic since the Gemfile is specifying per project

@mirestrepo
Copy link
Member Author

I opted to simply build, push and test in every case, unless there is a specific text on the commit. Having both jobs in one workflow requires a more complex hack to check the files that have changed, and I'm having Github Action hack-fatigue

@mirestrepo
Copy link
Member Author

mirestrepo commented Aug 3, 2020

I figured out how to only do the Docker build step if few files (Dockerfile, Gemfile.. ) have changed. I'll add those conditions from here in here soon

Copy link

@broarr broarr left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@@ -0,0 +1,24 @@
FROM hashicorp/terraform:0.12.29
Copy link

Choose a reason for hiding this comment

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

Looks like this image inherits from alpine linux, just be aware that alpine uses a different libc (musl) than any other linux operating system (except maybe void? and embedded linux solutions). There are some significant differences in the way the networking system calls work in musl vs glibc (the defacto standard). It shoudn't matter too much here, but I'm suspicious of alpine and musl

FROM hashicorp/terraform:0.12.29

ENV BUILD_PACKAGES bash curl-dev curl ruby-dev build-base python3
ENV RUBY_PACKAGES ruby-full
Copy link

Choose a reason for hiding this comment

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

These are creating cache layers for each ENV call. I'd inline these into the RUN call below that way the packages and the installation appear in a single cache layer

COPY Gemfile* ./
RUN gem install bundler
RUN bundle config set system 'true'
RUN bundle install
Copy link

Choose a reason for hiding this comment

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

You could def concat these three RUN directives with &&. I think that'd be better for the docker cache long term, though it doesn't super matter for an image this big

RUN bundle install


ENTRYPOINT ["/bin/bash"]
Copy link

Choose a reason for hiding this comment

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

Was this set to terraform in the parent container?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants