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

Use a pre-built Docker image base #25

Merged
merged 9 commits into from
Sep 7, 2021
Merged

Use a pre-built Docker image base #25

merged 9 commits into from
Sep 7, 2021

Conversation

jgehrcke
Copy link
Owner

@jgehrcke jgehrcke commented Sep 7, 2021

The Docker image build is rather heavy, and executed on every single GH actions run.

With this change, the Dockerfile in this repo uses a new image base: https://hub.docker.com/r/jgehrcke/github-repo-stats-base

This includes

  • the Chrome installation and
  • the heavy Python dependencies

Now we're not following python:3.8-slim-buster as a moving target anymore. This is often a red flag in security-critical environments. But not so much here. It's fine when the base gets a little out of date with the upstream Linux distro every now and then.

This approach / patch / PR is motivated by #24 and also my own observations where the Docker image build sometimes fails as of instabilities.

@jgehrcke
Copy link
Owner Author

jgehrcke commented Sep 7, 2021

$ make base-image
docker build -f base.Dockerfile . -t jgehrcke/github-repo-stats-base:9dec0ebaf
Sending build context to Docker daemon  4.146MB
Step 1/7 : FROM python:3.8-slim-buster
 ---> 4728acd2148c
Step 2/7 : RUN apt-get update && apt-get install -y -q --no-install-recommends     gnupg curl git jq moreutils ca-certificates unzip less tree pandoc     && rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> fa3d915db0e1
Step 3/7 : RUN curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
 ---> Using cache
 ---> 44189d2df2be
Step 4/7 : RUN echo "deb [arch=amd64]  http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
 ---> Using cache
 ---> 8722f8d3a56b
Step 5/7 : RUN apt-get -y update
 ---> Using cache
 ---> dbd46e4c70a6
Step 6/7 : RUN apt-get -y install google-chrome-stable
 ---> Using cache
 ---> f4f5e71762d9
Step 7/7 : RUN pip install pandas==1.3.2 PyGitHub==1.54.1 pytz retrying     selenium==3.141.0 webdriver_manager carbonplan[styles] altair==4.1.0
 ---> Using cache
 ---> 6d92e846be8b
Successfully built 6d92e846be8b
Successfully tagged jgehrcke/github-repo-stats-base:9dec0ebaf
$ make base-image-push
docker push jgehrcke/github-repo-stats-base:9dec0ebaf
The push refers to repository [docker.io/jgehrcke/github-repo-stats-base]
93bed792c1b9: Preparing 
93bed792c1b9: Layer already exists 
f230131547d3: Layer already exists 
d1e4e5062bf5: Layer already exists 
d1bf8f52195f: Layer already exists 
761903b33e48: Layer already exists 
6858b25d5a73: Layer already exists 
de9b19e6cd49: Layer already exists 
4e74918601aa: Layer already exists 
55ad5d8b8f0f: Layer already exists 
d000633a5681: Layer already exists 
9dec0ebaf: digest: sha256:d8dce9dfcf6ffd94a77a3a34d7540094b4a426b2746b80fa07f1e2d383c91279 size: 2635

To stress that this is just for
testing the image build locally,
and also a local reference
@jgehrcke jgehrcke merged commit 7b38bc5 into main Sep 7, 2021
@jgehrcke jgehrcke deleted the jp/dockerimage branch June 10, 2022 12:02
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

Successfully merging this pull request may close these issues.

None yet

1 participant