-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
22 lines (15 loc) · 801 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
ARG GO_BUILDER=docker.io/library/golang:1.22
ARG BASE_IMAGE=docker.io/library/alpine:3.12
FROM ${GO_BUILDER} AS builder
ARG VERSION
ARG GOPROXY
WORKDIR /workspace
COPY . .
RUN GOPROXY=${GOPROXY} go mod download
RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -ldflags "-w -s -X github.com/linuxsuren/api-testing/pkg/version.version=${VERSION}\
-X github.com/linuxsuren/api-testing/pkg/version.date=$(date +%Y-%m-%d)" -o atest-store-elasticsearch .
FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.source=https://github.com/LinuxSuRen/atest-ext-store-elasticsearch
LABEL org.opencontainers.image.description="Elasticsearch Store Extension of the API Testing."
COPY --from=builder /workspace/atest-store-elasticsearch /usr/local/bin/atest-store-elasticsearch
CMD [ "atest-store-elasticsearch" ]