Created
July 14, 2019 20:39
-
-
Save cirocosta/29177e40e3fc0ca92e73d94c288a5849 to your computer and use it in GitHub Desktop.
An example of how to build the `concourse/concourse` image with a modified `gdn`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang AS base | |
RUN apt update && \ | |
apt install -y \ | |
git gcc libseccomp-dev | |
ENV \ | |
CC=gcc \ | |
CGO_ENABLED=1 | |
FROM base AS gdn-base | |
COPY ./src /src | |
WORKDIR /src/guardian | |
FROM gdn-base AS gdn-build | |
RUN go build \ | |
-tags netgo \ | |
-ldflags "-extldflags '-static'" \ | |
-o /bin/gdn \ | |
./cmd/gdn | |
FROM gdn-base AS gdn-dadoo-build | |
RUN go build \ | |
-tags netgo \ | |
-ldflags "-extldflags '-static'" \ | |
-o /bin/dadoo \ | |
./cmd/dadoo | |
FROM gdn-base AS gdn-init-build | |
RUN set -x && \ | |
cd ./cmd/init && \ | |
$CC -static -o /bin/init \ | |
init.c ignore_sigchild.c | |
FROM concourse/concourse | |
ARG RUNC_URL=https://github.com/opencontainers/runc/releases/download/v1.0.0-rc8/runc.amd64 | |
RUN apt update && apt install -y iptables curl | |
RUN curl -SOL ${RUNC_URL} && install -m 0755 ./runc.amd64 /usr/local/concourse/bin/runc | |
ENV CONCOURSE_GARDEN_BIN /usr/local/concourse/bin/gdn | |
ENV CONCOURSE_GARDEN_INIT_BIN /usr/local/concourse/bin/init | |
ENV CONCOURSE_GARDEN_RUNTIME_PLUGIN /usr/local/concourse/bin/runc | |
ENV CONCOURSE_GARDEN_DADOO_BIN /usr/local/concourse/bin/dadoo | |
COPY --from=gdn-dadoo-build /bin/dadoo /usr/local/concourse/bin/dadoo | |
COPY --from=gdn-init-build /bin/init /usr/local/concourse/bin/init | |
COPY --from=gdn-build /bin/gdn /usr/local/concourse/bin/gdn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
garden-runc-release
, the "umbrella repo" from guardian$ git clone https://github.com/cloudfoundry/garden-runc-release --recurse-submodules -j4
modify
guardian
(under./src/guardian
)build the modified concourse image
$ docker build -t cirocosta/modified-concourse .