Skip to content

Instantly share code, notes, and snippets.

@kjmkznr
Created July 28, 2019 04:17
Show Gist options
  • Save kjmkznr/f35c392dfce175b8c75923cdb653a319 to your computer and use it in GitHub Desktop.
Save kjmkznr/f35c392dfce175b8c75923cdb653a319 to your computer and use it in GitHub Desktop.
Mackerel Container Agent Image for ARM
FROM golang:alpine AS builder
RUN apk update && \
apk add --no-cache git ca-certificates && \
update-ca-certificates
ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=arm
ENV GOARM=7
COPY . /src/
WORKDIR /src/
RUN go build -o /mackerel-container-agent ./cmd/mackerel-container-agent/...
# Create appuser
RUN adduser -D -g '' mackerel
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /mackerel-container-agent /usr/local/bin/mackerel-container-agent
ENTRYPOINT ["/usr/local/bin/mackerel-container-agent"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment