mirror of
https://github.com/postmannen/ctrl.git
synced 2025-01-19 06:09:30 +00:00
20 lines
360 B
Docker
20 lines
360 B
Docker
# build stage
|
|
FROM golang:1.22-alpine AS build-env
|
|
RUN apk --no-cache add build-base git gcc
|
|
|
|
RUN mkdir -p /build
|
|
COPY ./ /build/
|
|
|
|
WORKDIR /build/cmd/ctrl/
|
|
RUN go version
|
|
RUN go build -o ctrl
|
|
|
|
# final stage
|
|
FROM alpine
|
|
|
|
RUN apk update && apk add curl && apk add nmap
|
|
|
|
WORKDIR /app
|
|
COPY --from=build-env /build/cmd/ctrl/ctrl /app/
|
|
|
|
CMD ["ash","-c","/app/ctrl"]
|