websoft9/docker/deployment/Dockerfile

15 lines
528 B
Docker
Raw Normal View History

2023-10-17 17:42:38 +08:00
# step1: Build entrypoint execute program init_portainer by golang
2023-09-11 08:40:56 +08:00
FROM golang:latest AS builder
WORKDIR /
2023-09-11 16:51:48 +08:00
COPY init_portainer.go /
RUN go build -o init_portainer /init_portainer.go
2023-09-13 08:38:24 +08:00
RUN chmod +x /init_portainer
2023-09-11 08:40:56 +08:00
2023-10-17 17:42:38 +08:00
# step2: Copy build go program to portainer
2023-10-17 14:42:09 +08:00
# Dockerfile refer to: https://github.com/portainer/portainer/blob/develop/build/linux/Dockerfile
2023-09-11 08:40:56 +08:00
FROM portainer/portainer-ce:2.19.0
2023-09-18 09:31:29 +08:00
LABEL maintainer="websoft9<help@websoft9.com>"
2023-09-18 09:01:53 +08:00
LABEL version="2.19.0"
2023-09-19 16:28:36 +08:00
COPY --from=builder /init_portainer /
2023-09-23 10:41:35 +08:00
2023-09-19 16:28:36 +08:00
ENTRYPOINT ["/init_portainer"]