Created
March 22, 2021 09:44
-
-
Save nanmu42/3e015952093ee6fddfeddb062b7160a8 to your computer and use it in GitHub Desktop.
Golang: Dockerfile based on Debian
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:buster as golang | |
RUN apt-get update && \ | |
DEBIAN_FRONTEND=noninteractive apt-get install -y \ | |
ca-certificates \ | |
tzdata \ | |
build-essential \ | |
tar \ | |
bash | |
WORKDIR /app | |
COPY . . | |
RUN make | |
FROM debian:buster-slim | |
# Dependencies | |
RUN apt-get update && \ | |
DEBIAN_FRONTEND=noninteractive apt-get install -y \ | |
ca-certificates \ | |
tzdata \ | |
bash \ | |
&& rm -rf /var/lib/apt/lists/* | |
# where application lives | |
WORKDIR /app | |
# Copy the products | |
COPY --from=golang /app/bin/* ./ | |
# env | |
EXPOSE 8000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment