Skip to content

Commit

Permalink
Cache go build and set CMD
Browse files Browse the repository at this point in the history
  • Loading branch information
ajsutton committed Sep 10, 2024
1 parent 0a390d1 commit 66afbf0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Dockerfile.release
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
FROM golang:1.21.1-alpine3.18 AS builder
WORKDIR /build
ARG ASTERISC_TAG

# Copy the context into the container
ADD . .

# Install deps
RUN apk add --no-cache git make bash

# Clone and build Asterisc @ `ASTERISC_TAG`
RUN make
RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build make

FROM alpine:3.18 AS export

RUN apk add --no-cache bash
SHELL ["/bin/bash", "-c"]

COPY --from=builder /build/rvgo/bin/asterisc /usr/local/bin/asterisc
CMD ["asterisc"]

0 comments on commit 66afbf0

Please sign in to comment.