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

Dockerfile needs some love #267

Open
LanceMcCarthy opened this issue Dec 15, 2022 · 2 comments
Open

Dockerfile needs some love #267

LanceMcCarthy opened this issue Dec 15, 2022 · 2 comments

Comments

@LanceMcCarthy
Copy link

LanceMcCarthy commented Dec 15, 2022

If you try to deploy the docs-seed (with a target documentation) using Docker, there are problems out-of-the-box.

For example, one Gem bundler says it uses v1, while the Gemfile.lock requires v2 or later. I was able to fix this by installing 2.0 or later in the Dockerfile's commands and setting the environment variable.

RUN gem update --system --quiet && gem install bundler -v '~> 2.1'
  
ENV BUNDLER_VERSION 2.1

Another issue was around the Docker build context failing to satisfy some apt commands. I've haven't gotten to the bottom of which packages are to blame. I just put the --force-yes sledgehammer on all of them to workaround it for now.

Here is the combination that was successful for me locally from WSL (WSL2 Ubuntu). I don't know if it will be useful for the wider scope of folks/environments, but I thought I'd share anyways.

Dockerfile

# LINE 17 

ENV APP_ROOT /app_root

# WORKAROUND 1 - Install the bundler v2+
RUN \
  gem update --system --quiet && \
  gem install bundler -v '~> 2.1'
  
ENV BUNDLER_VERSION 2.1

# By adding Gemfiles and invoke bundle install before copy all files we are using container cache for gems.
ADD Gemfile ${APP_ROOT}/
ADD Gemfile.lock ${APP_ROOT}/

WORKDIR ${APP_ROOT}
RUN bundle check || bundle install

# Continue ...

Gemfile.lock

GEM
...

PLATFORMS
...

DEPENDENCIES
...

# WORKAROUND 2 - Downgrade this
BUNDLED WITH
   1.16.0
@RickHellwege
Copy link

I was able to resolve the issue by changing the version of Bundler in Gemfile.lock from 2 to 1.

@LanceMcCarthy
Copy link
Author

Yep, that problem comes from the docs-seed repo's Gemfile.lock has it set to v2 =>

docs-seed/Gemfile.lock

Lines 126 to 127 in 7f3a1c9

BUNDLED WITH
2

If v2 is a requirement, this can be permanently handled by ensuring the Dockerfile installs the v2+ bundler.

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

No branches or pull requests

2 participants