Skip to content

Instantly share code, notes, and snippets.

@filipeandre
Last active June 7, 2019 13:10
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 filipeandre/91b2167ec2f58f599cb3914b5e703fc2 to your computer and use it in GitHub Desktop.
Save filipeandre/91b2167ec2f58f599cb3914b5e703fc2 to your computer and use it in GitHub Desktop.
Dockerfile to compile go app to arm-7
FROM golang:1.12
WORKDIR /go/src/app
RUN apt-get update && apt-get install -y \
gcc-arm-linux-gnueabihf \
&& rm -rf /var/lib/apt/lists/*
ENV CC=arm-linux-gnueabihf-gcc
ENV CXX=arm-linux-gnueabihf-g++
ENV CGO_ENABLED=1
ENV GOOS=linux
ENV GOARCH=arm
ENV GOARM=7
CMD go build -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment