-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,28 @@ | ||
# Start from the latest golang base image | ||
FROM golang:alpine | ||
|
||
# Add Maintainer Info | ||
LABEL org.opencontainers.image.source=https://github.com/chefgs/linktoqr | ||
LABEL description="This container image can be used to generate QR from the given URL or Text." | ||
LABEL org.opencontainers.image.licenses=MIT | ||
|
||
# Set necessary environmet variables needed for our image | ||
# Set necessary environment variables needed for our image | ||
ENV CGO_ENABLED=0 \ | ||
GOOS=linux | ||
GOOS=linux \ | ||
GO111MODULE=on | ||
|
||
WORKDIR $GOPATH/src/linktoqr | ||
# Move to working directory /linktoqr | ||
WORKDIR /linktoqr | ||
|
||
COPY ./*go* . | ||
# Copy and download dependency using go mod | ||
COPY go.mod . | ||
RUN go mod tidy | ||
|
||
RUN go build -o /linktoqr | ||
# Copy the code into the container | ||
COPY . . | ||
|
||
# Export necessary port | ||
EXPOSE 1718 | ||
|
||
CMD ["/linktoqr"] | ||
# Command to run the executable | ||
CMD ["go", "run", "./..."] |