-
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
s0s01qp
committed
Jul 27, 2021
1 parent
ee13b04
commit 675c3b6
Showing
3 changed files
with
78 additions
and
2 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
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Start from the latest alpine based golang base image | ||
FROM golang:alpine as builder | ||
|
||
# Build stamp argument | ||
ARG buildstamp | ||
|
||
# Git Commit Id | ||
ARG gitCommitId | ||
|
||
# Git Primary Branch | ||
ARG gitPrimaryBranch | ||
|
||
# Git Repository | ||
ARG gitRepository | ||
|
||
# Git username | ||
ARG gitUsername | ||
|
||
# Hostname | ||
ARG hostname | ||
|
||
# App Version | ||
ARG appVersion | ||
|
||
# Add maintainer info | ||
LABEL maintainer="Shubham Sinha <[email protected]>" | ||
|
||
# Set the current working directory inside the container | ||
WORKDIR /app | ||
|
||
# Copy go mod and sum files | ||
COPY go.mod go.sum ./ | ||
|
||
# Download all dependencies | ||
RUN go mod download | ||
|
||
# Copy the source from the current directory to the working directory inside the container | ||
COPY . . | ||
|
||
# Build Moxy | ||
RUN GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/sinhashubham95/go-actuator/core.BuildStamp=$buildstamp -X github.com/sinhashubham95/go-actuator/core.GitCommitID=$gitCommitId -X github.com/sinhashubham95/go-actuator/core.GitPrimaryBranch=$gitPrimaryBranch -X github.com/sinhashubham95/go-actuator/core.GitURL=https://github.com/$gitRepository -X github.com/sinhashubham95/go-actuator/core.Username=$gitUsername -X github.com/sinhashubham95/go-actuator/core.HostName=$hostname -X github.com/sinhashubham95/go-actuator/core.GitCommitTime=$buildstamp -X github.com/sinhashubham95/go-actuator/core.GitCommitAuthor=$gitUsername" | ||
|
||
# Start again from scratch | ||
FROM scratch | ||
|
||
# Copy the binary | ||
COPY --from=builder /app/moxy /moxy | ||
|
||
# Set the working directory to data so all created files | ||
# can be mapped to physical files on disk | ||
WORKDIR /data | ||
|
||
# Run binary | ||
ENTRYPOINT ["../moxy", "--env=dev", "--name=moxy", "--version=$appVersion", "--port=$port", "--persistence-path=persistence.db"] |
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,4 +1,4 @@ | ||
{ | ||
"name": "moxy", | ||
"version": "0.16.0" | ||
"version": "0.17.0" | ||
} |