Skip to content

Commit

Permalink
perf(container): ⚡ don't install mage for container build
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuar committed Oct 9, 2024
1 parent 8be5795 commit dace627
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

FROM docker.io/alpine@sha256:0a4eaa0eecf5f8c050e5bba433f58c052be7587ee8af3e8b3910ef9ab5fbe9f5 AS builder
# Copy go from official image.
COPY --from=golang:1.23.1-alpine /usr/local/go/ /usr/local/go/
COPY --from=golang:1.23.2-alpine /usr/local/go/ /usr/local/go/
ENV PATH="/root/go/bin:/usr/local/go/bin:${PATH}"
# Import TARGETPLATFORM.
ARG TARGETPLATFORM
Expand All @@ -15,12 +15,10 @@ WORKDIR /usr/src/go-hass-agent
ADD . .
# install bash
RUN apk update && apk add bash
# install mage
RUN go install github.com/magefile/[email protected]
# install build dependencies
RUN mage -v -d build/magefiles -w . preps:deps
RUN go run github.com/magefile/mage -v -d build/magefiles -w . preps:deps
# build the binary
RUN mage -v -d build/magefiles -w . build:full
RUN go run github.com/magefile/mage -v -d build/magefiles -w . build:full

FROM docker.io/alpine@sha256:0a4eaa0eecf5f8c050e5bba433f58c052be7587ee8af3e8b3910ef9ab5fbe9f5
# Add image labels.
Expand Down

0 comments on commit dace627

Please sign in to comment.