Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Last active September 18, 2021 06:01
Show Gist options
  • Save percybolmer/1b3da00eafcff255b2c692bb90f82923 to your computer and use it in GitHub Desktop.
Save percybolmer/1b3da00eafcff255b2c692bb90f82923 to your computer and use it in GitHub Desktop.
FROM golang:1.5
LABEL maintainer="PercyBolmer@medium"
#ARG is used during the Image build
ARG port=8080
# Assign Environment variabel PORT the value of port. The user running the container can then override this with the -e flag
ENV PORT=${port}
RUN mkdir /app
COPY main.go /app
WORKDIR /app
RUN go build -o helloer .
EXPOSE ${PORT}
CMD [ "/app/helloer" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment