github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/Dockerfile (about)

     1  # NOTE: this Dockerfile is purely for local development! it is *not* used for
     2  # the official 'concourse/concourse' image.
     3  
     4  FROM concourse/dev AS base
     5  
     6  # generate keys (with 1024 bits just so they generate faster)
     7  RUN mkdir -p /concourse-keys
     8  RUN concourse generate-key -t rsa -b 1024 -f /concourse-keys/session_signing_key
     9  RUN concourse generate-key -t ssh -b 1024 -f /concourse-keys/tsa_host_key
    10  RUN concourse generate-key -t ssh -b 1024 -f /concourse-keys/worker_key
    11  RUN cp /concourse-keys/worker_key.pub /concourse-keys/authorized_worker_keys
    12  
    13  # 'web' keys
    14  ENV CONCOURSE_SESSION_SIGNING_KEY     /concourse-keys/session_signing_key
    15  ENV CONCOURSE_TSA_AUTHORIZED_KEYS     /concourse-keys/authorized_worker_keys
    16  ENV CONCOURSE_TSA_HOST_KEY            /concourse-keys/tsa_host_key
    17  
    18  # 'worker' keys
    19  ENV CONCOURSE_TSA_PUBLIC_KEY          /concourse-keys/tsa_host_key.pub
    20  ENV CONCOURSE_TSA_WORKER_PRIVATE_KEY  /concourse-keys/worker_key
    21  
    22  # download go modules separately so this doesn't re-run on every change
    23  WORKDIR /src
    24  COPY go.mod .
    25  COPY go.sum .
    26  RUN grep '^replace' go.mod || go mod download
    27  
    28  # build the init executable for containerd
    29  COPY ./cmd/init/init.c /tmp/init.c
    30  RUN gcc -O2 -static -o /usr/local/concourse/bin/init /tmp/init.c && rm /tmp/init.c
    31  
    32  # build Concourse without using 'packr' so that the volume in the next stage
    33  # can live-update
    34  COPY . .
    35  RUN go build -gcflags=all="-N -l" -o /usr/local/concourse/bin/concourse \
    36        ./cmd/concourse
    37  RUN set -x && \
    38        go build --tags 'netgo osusergo' -a -ldflags '-extldflags "-static"' -o /tmp/fly ./fly && \
    39        tar -C /tmp -czf /usr/local/concourse/fly-assets/fly-$(go env GOOS)-$(go env GOARCH).tgz fly && \
    40        rm /tmp/fly
    41  
    42  # extend base stage with setup for local docker-compose workflow
    43  FROM base
    44  
    45  # set up a volume so locally built web UI changes auto-propagate
    46  VOLUME /src