-
-
Notifications
You must be signed in to change notification settings - Fork 126
Expand file tree
/
Copy pathDockerfile.cli-tool
More file actions
20 lines (13 loc) · 752 Bytes
/
Dockerfile.cli-tool
File metadata and controls
20 lines (13 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
FROM golang:1.25.0-alpine AS build_base
## Usage:
## docker build . -f Dockerfile.cli-tool -t gokapi-cli
## docker run -it --rm -v gokapi-cli-config:/app/config gokapi-cli
RUN mkdir /compile
COPY go.mod /compile
RUN cd /compile && go mod download
COPY . /compile
RUN cd /compile && go generate ./... && CGO_ENABLED=0 go build -ldflags="-s -w -X 'github.com/forceu/gokapi/internal/environment.IsDocker=true' -X 'github.com/forceu/gokapi/internal/environment.Builder=Project Docker File' -X 'github.com/forceu/gokapi/internal/environment.BuildTime=$(date)'" -o /compile/gokapi-cli github.com/forceu/gokapi/cmd/cli-uploader
FROM alpine:3.19
COPY --from=build_base /compile/gokapi-cli /app/gokapi-cli
WORKDIR /app
ENTRYPOINT ["/app/gokapi-cli"]