websoft9/docker/w9portainer/Dockerfile

13 lines
452 B
Docker
Raw Normal View History

2023-09-11 08:40:56 +08:00
# step1: build entrypoint execute program init_portainer by golang
FROM golang:latest AS builder
WORKDIR /
2023-09-11 16:51:48 +08:00
COPY init_portainer.go /
COPY init_endpoint.go /
RUN go build -o init_portainer /init_portainer.go
RUN go build -o init_endpoint /init_endpoint.go
RUN chmod +x /init_portainer /init_endpoint
2023-09-11 08:40:56 +08:00
# step2: copy build go program to portainer
FROM portainer/portainer-ce:2.19.0
2023-09-11 16:51:48 +08:00
COPY --from=builder /init_portainer /
COPY --from=builder /init_endpoint /