2021-05-14 15:23:04 +02:00
|
|
|
# build stage
|
2024-03-07 23:17:24 +01:00
|
|
|
FROM golang:1.22-alpine AS build-env
|
2021-05-14 15:23:04 +02:00
|
|
|
RUN apk --no-cache add build-base git gcc
|
2021-09-07 06:24:21 +02:00
|
|
|
|
|
|
|
RUN mkdir -p /build
|
2022-02-18 11:55:15 +01:00
|
|
|
COPY ./ /build/
|
2021-09-07 06:24:21 +02:00
|
|
|
|
2023-10-04 22:58:42 +02:00
|
|
|
WORKDIR /build/cmd/ctrl/
|
2021-09-07 06:24:21 +02:00
|
|
|
RUN go version
|
2023-10-04 22:58:42 +02:00
|
|
|
RUN go build -o ctrl
|
2021-05-14 15:23:04 +02:00
|
|
|
|
|
|
|
# final stage
|
|
|
|
FROM alpine
|
2021-09-07 06:24:21 +02:00
|
|
|
|
|
|
|
RUN apk update && apk add curl && apk add nmap
|
|
|
|
|
2021-05-14 15:23:04 +02:00
|
|
|
WORKDIR /app
|
2023-10-04 22:58:42 +02:00
|
|
|
COPY --from=build-env /build/cmd/ctrl/ctrl /app/
|
2021-05-14 15:23:04 +02:00
|
|
|
|
2024-03-27 12:48:17 +01:00
|
|
|
CMD ["ash","-c","/app/ctrl"]
|