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

Building a CentOS 7.x Docker image #1137

Merged
merged 2 commits into from
Dec 11, 2019

Conversation

moensch
Copy link
Contributor

@moensch moensch commented Dec 10, 2019

Creates a buildkite/agent docker image based on centos:7.7.1908.

Sadly, image size came out to be 757MB, compared to 466MB for the current 3.16.0-ubuntu image. Suggestions for further size reduction welcome.

A couple of notes:

  • openssh-client is openssh-clients on CentOS
  • crontabs package is what provides /bin/run-parts used in the entrypoint
  • CentOS does not provide jq, but EPEL does
  • Both CentOS and EPEL have rather old docker versions, installing from docker-ce directly

@keithpitt keithpitt requested review from lox and a team December 11, 2019 00:37
Copy link
Member

@keithpitt keithpitt left a comment

Choose a reason for hiding this comment

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

This looks good to me. I'll wait for a double check from @buildkite/golang first.

Copy link
Member

@pda pda left a comment

Choose a reason for hiding this comment

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

Seems good;

I can reproduce the docker build locally:

go build -o packaging/docker/centos-linux/buildkite-agent
docker build --tag tmp packaging/docker/centos-linux

Here's a diff against the ubuntu Dockerfile; changes look legit to me;

for f in packaging/docker/centos-linux/*; do diff -u "$f" "${f/centos/ubuntu}"; done
--- packaging/docker/centos-linux/Dockerfile	2019-12-11 11:58:28.035835826 +1100
+++ packaging/docker/ubuntu-linux/Dockerfile	2019-11-15 12:22:44.795548141 +1100
@@ -1,20 +1,19 @@
-FROM centos:7.7.1908
+FROM ubuntu:18.04
 
-RUN yum -y install \
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
       curl \
       ca-certificates \
       bash \
       git \
       perl \
       rsync \
-      openssh-clients \
+      openssh-client \
       curl \
-      crontabs \
-      epel-release \
-    && yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo \
-    && yum -y install docker-ce jq \
-    && yum clean all \
-    && rm -rf /var/cache/yum*
+      docker.io \
+      jq \
+    && rm -rf /var/lib/apt/lists/*
 
 RUN curl -Lfs -o /sbin/tini  https://github.com/krallin/tini/releases/download/v0.18.0/tini \
     && chmod +x /sbin/tini \

I've (rip)grepped to verify centos is being handled in this branch everywhere that ubuntu is mentioned in master in the .buildkite/ and packaging/docker/ dirs that this PR touches.

🚢

@keithpitt keithpitt merged commit 8fb86ee into buildkite:master Dec 11, 2019
@moensch moensch deleted the add-centos-docker branch December 12, 2019 01:16
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

3 participants