diff --git a/.gitignore b/.gitignore index efcc6fe1fcb523b89c70c2b36b66b876f4486677..456e977277be5bd87395283ace85f3565f31be5b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,8 +6,10 @@ builds/ commands/helpers/archive.zip executors/docker/bindata.go dockerfiles/alpine/gitlab-ci-multi-runner-linux-amd64 +dockerfiles/alpine/checksums.sha256 dockerfiles/build/gitlab-runner-helper dockerfiles/ubuntu/gitlab-ci-multi-runner_amd64.deb +dockerfiles/ubuntu/checksums.sha256 .idea/ .editorconfig tests/ubuntu/.vagrant diff --git a/ci/release_docker_images b/ci/release_docker_images index 634f0bc16d58f802d13a33828efe225da870fa4d..c8d8c6d8e95ef9d7f3d8b2522f5c2855fca4fcaf 100755 --- a/ci/release_docker_images +++ b/ci/release_docker_images @@ -83,7 +83,9 @@ logout() { } cp out/deb/gitlab-ci-multi-runner_amd64.deb dockerfiles/ubuntu/ +cp dockerfiles/checksums.sha256 dockerfiles/ubuntu cp out/binaries/gitlab-ci-multi-runner-linux-amd64 dockerfiles/alpine +cp dockerfiles/checksums.sha256 dockerfiles/alpine build "gitlab/gitlab-runner:ubuntu-${ref_tag}" dockerfiles/ubuntu build "gitlab/gitlab-runner:alpine-${ref_tag}" dockerfiles/alpine diff --git a/dockerfiles/alpine/Dockerfile b/dockerfiles/alpine/Dockerfile index dc08f2e7ccbb61a291e8f18993376ff29a8ac824..c8fb61115dceb560291874eb0594611b7bf9bb38 100644 --- a/dockerfiles/alpine/Dockerfile +++ b/dockerfiles/alpine/Dockerfile @@ -2,23 +2,27 @@ FROM alpine RUN adduser -D -S -h /home/gitlab-runner gitlab-runner -ADD https://github.com/Yelp/dumb-init/releases/download/v1.0.2/dumb-init_1.0.2_amd64 /usr/bin/dumb-init -RUN chmod +x /usr/bin/dumb-init - RUN apk add --update \ - bash \ - ca-certificates \ - git \ - openssl \ - wget + bash \ + ca-certificates \ + git \ + openssl \ + wget COPY gitlab-ci-multi-runner-linux-amd64 /usr/bin/gitlab-ci-multi-runner +COPY checksums.sha256 /tmp/ RUN chmod +x /usr/bin/gitlab-ci-multi-runner && \ - ln -s /usr/bin/gitlab-ci-multi-runner /usr/bin/gitlab-runner && \ - wget -q https://github.com/docker/machine/releases/download/v0.10.0/docker-machine-Linux-x86_64 -O /usr/bin/docker-machine && \ - chmod +x /usr/bin/docker-machine && \ - mkdir -p /etc/gitlab-runner/certs && \ - chmod -R 700 /etc/gitlab-runner + ln -s /usr/bin/gitlab-ci-multi-runner /usr/bin/gitlab-runner && \ + gitlab-runner --version && \ + mkdir -p /etc/gitlab-runner/certs && \ + chmod -R 700 /etc/gitlab-runner && \ + wget -q https://github.com/docker/machine/releases/download/v0.12.2/docker-machine-Linux-x86_64 -O /usr/bin/docker-machine && \ + chmod +x /usr/bin/docker-machine && \ + docker-machine --version && \ + wget -q https://github.com/Yelp/dumb-init/releases/download/v1.0.2/dumb-init_1.0.2_amd64 -O /usr/bin/dumb-init && \ + chmod +x /usr/bin/dumb-init && \ + dumb-init --version && \ + sha256sum -c -w /tmp/checksums.sha256 COPY entrypoint / RUN chmod +x /entrypoint diff --git a/dockerfiles/checksums.sha256 b/dockerfiles/checksums.sha256 new file mode 100644 index 0000000000000000000000000000000000000000..f10841046e9f90714accd083b4183b87f425c15a --- /dev/null +++ b/dockerfiles/checksums.sha256 @@ -0,0 +1,2 @@ +3c0a1a03653dff205f27bb178773f3c294319435a2589cf3cb4456423f8cef08 /usr/bin/docker-machine +a8defac40aaca2ca0896c7c5adbc241af60c7c3df470c1a4c469a860bd805429 /usr/bin/dumb-init diff --git a/dockerfiles/ubuntu/Dockerfile b/dockerfiles/ubuntu/Dockerfile index 610da371ecc8309f450794f98356dc997ce4a7c0..7a9611078f4942a52527a95e95e9cc752bcb7b55 100644 --- a/dockerfiles/ubuntu/Dockerfile +++ b/dockerfiles/ubuntu/Dockerfile @@ -1,8 +1,5 @@ FROM ubuntu:14.04 -ADD https://github.com/Yelp/dumb-init/releases/download/v1.0.2/dumb-init_1.0.2_amd64 /usr/bin/dumb-init -RUN chmod +x /usr/bin/dumb-init - RUN apt-get update -y && \ apt-get upgrade -y && \ apt-get install -y ca-certificates wget apt-transport-https vim nano && \ @@ -10,6 +7,7 @@ RUN apt-get update -y && \ rm -rf /var/lib/apt/lists/* COPY gitlab-ci-multi-runner_amd64.deb /tmp/ +COPY checksums.sha256 /tmp/ RUN dpkg -i /tmp/gitlab-ci-multi-runner_amd64.deb; \ apt-get update && \ apt-get -f install -y && \ @@ -17,10 +15,15 @@ RUN dpkg -i /tmp/gitlab-ci-multi-runner_amd64.deb; \ rm -rf /var/lib/apt/lists/* && \ rm /tmp/gitlab-ci-multi-runner_amd64.deb && \ gitlab-runner --version && \ - wget -q https://github.com/docker/machine/releases/download/v0.10.0/docker-machine-Linux-x86_64 -O /usr/bin/docker-machine && \ - chmod +x /usr/bin/docker-machine && \ mkdir -p /etc/gitlab-runner/certs && \ - chmod -R 700 /etc/gitlab-runner + chmod -R 700 /etc/gitlab-runner && \ + wget -q https://github.com/docker/machine/releases/download/v0.12.2/docker-machine-Linux-x86_64 -O /usr/bin/docker-machine && \ + chmod +x /usr/bin/docker-machine && \ + docker-machine --version && \ + wget -q https://github.com/Yelp/dumb-init/releases/download/v1.0.2/dumb-init_1.0.2_amd64 -O /usr/bin/dumb-init && \ + chmod +x /usr/bin/dumb-init && \ + dumb-init --version && \ + sha256sum --check --strict /tmp/checksums.sha256 COPY entrypoint / RUN chmod +x /entrypoint