Skip to content

Commit

Permalink
update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
dandersonsw committed Apr 11, 2024
1 parent 3af8ebe commit 0e46d7b
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
# syntax = docker/dockerfile:experimental
ARG base_image

FROM concourse/golang-builder AS builder
WORKDIR /src
COPY go.mod /src/go.mod
COPY go.sum /src/go.sum
RUN --mount=type=cache,target=/root/.cache/go-build go get -d ./...
COPY . /src
ENV CGO_ENABLED 0
RUN go build -o /assets/task ./cmd/task
RUN go build -o /assets/build ./cmd/build
WORKDIR /src
COPY go.mod /src/go.mod
COPY go.sum /src/go.sum
RUN --mount=type=cache,target=/root/.cache/go-build go get -d ./...
COPY . /src
ENV CGO_ENABLED 0
RUN go build -o /assets/task ./cmd/task
RUN go build -o /assets/build ./cmd/build

FROM moby/buildkit:v0.11.0 AS task
COPY --from=builder /assets/task /usr/bin/
COPY --from=builder /assets/build /usr/bin/
COPY bin/setup-cgroups /usr/bin/
ENTRYPOINT ["task"]
COPY --from=builder /assets/task /usr/bin/
COPY --from=builder /assets/build /usr/bin/
COPY bin/setup-cgroups /usr/bin/

FROM task
FROM $(base_image) as base
COPY --from=task /usr/bin /usr/bin/
ENTRYPOINT ["task"]

FROM base

0 comments on commit 0e46d7b

Please sign in to comment.