Skip to content

Instantly share code, notes, and snippets.

@peterhellberg
Last active March 22, 2019 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterhellberg/2c20a09528adb3f304cf5311a85e58a7 to your computer and use it in GitHub Desktop.
Save peterhellberg/2c20a09528adb3f304cf5311a85e58a7 to your computer and use it in GitHub Desktop.
Dockerfile for CGO app under balenaOS on RPi3
FROM balenalib/raspberrypi3-alpine-golang as builder
WORKDIR /go/src/rpi-server
COPY . ./
RUN apk add musl-dev linux-headers
RUN go install -a -tags netgo -ldflags '-extldflags "-static"'
FROM resin/scratch
COPY --from=builder /go/bin/rpi-server /rpi-server
COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs
CMD ["/rpi-server"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment