2023-04-18 12:25:55 +08:00
|
|
|
FROM golang:1.18 AS builder
|
2022-06-08 17:32:17 +08:00
|
|
|
|
|
|
|
WORKDIR /workspace
|
2023-04-18 12:25:55 +08:00
|
|
|
COPY cmd/ cmd/
|
|
|
|
COPY pkg/ pkg/
|
2023-06-08 17:27:40 +08:00
|
|
|
COPY extensions/ extensions/
|
2023-04-18 12:25:55 +08:00
|
|
|
COPY sample/ sample/
|
|
|
|
COPY go.mod go.mod
|
|
|
|
COPY go.sum go.sum
|
2023-06-08 17:27:40 +08:00
|
|
|
COPY go.work go.work
|
|
|
|
COPY go.work.sum go.work.sum
|
2023-04-18 12:25:55 +08:00
|
|
|
COPY main.go main.go
|
|
|
|
COPY README.md README.md
|
|
|
|
COPY LICENSE LICENSE
|
|
|
|
|
2022-06-08 17:32:17 +08:00
|
|
|
RUN go mod download
|
2023-04-04 13:28:18 +08:00
|
|
|
RUN CGO_ENABLE=0 go build -ldflags "-w -s" -o atest .
|
2023-06-08 17:27:40 +08:00
|
|
|
RUN CGO_ENABLE=0 go build -ldflags "-w -s" -o atest-collector extensions/collector/main.go
|
2022-06-08 17:32:17 +08:00
|
|
|
|
2023-04-04 14:13:16 +08:00
|
|
|
FROM ubuntu:23.04
|
2022-06-08 17:32:17 +08:00
|
|
|
|
|
|
|
LABEL "com.github.actions.name"="API testing"
|
|
|
|
LABEL "com.github.actions.description"="API testing"
|
|
|
|
LABEL "com.github.actions.icon"="home"
|
|
|
|
LABEL "com.github.actions.color"="red"
|
|
|
|
|
|
|
|
LABEL "repository"="https://github.com/linuxsuren/api-testing"
|
|
|
|
LABEL "homepage"="https://github.com/linuxsuren/api-testing"
|
|
|
|
LABEL "maintainer"="Rick <linuxsuren@gmail.com>"
|
|
|
|
|
|
|
|
LABEL "Name"="API testing"
|
|
|
|
|
2023-04-04 14:13:16 +08:00
|
|
|
COPY --from=builder /workspace/atest /usr/local/bin/atest
|
2023-06-08 17:27:40 +08:00
|
|
|
COPY --from=builder /workspace/atest-collector /usr/local/bin/atest-collector
|
2023-04-18 12:25:55 +08:00
|
|
|
COPY --from=builder /workspace/LICENSE /LICENSE
|
|
|
|
COPY --from=builder /workspace/README.md /README.md
|
2022-06-08 17:32:17 +08:00
|
|
|
|
2023-04-04 14:13:16 +08:00
|
|
|
CMD ["atest", "server"]
|