2024-07-29 03:02:59 +00:00
|
|
|
# modify time: 202407291102, you can modify here to trigger Docker Build action
|
2023-10-17 09:42:38 +00:00
|
|
|
# step1: Build entrypoint execute program init_portainer by golang
|
2023-10-18 08:58:47 +00:00
|
|
|
|
2023-09-11 00:40:56 +00:00
|
|
|
FROM golang:latest AS builder
|
|
|
|
WORKDIR /
|
2023-09-11 08:51:48 +00:00
|
|
|
COPY init_portainer.go /
|
2023-10-19 10:31:27 +00:00
|
|
|
# CGO_ENABLED=0 can not depend on any dynamic library
|
2023-10-19 10:16:59 +00:00
|
|
|
RUN CGO_ENABLED=0 go build -o init_portainer /init_portainer.go
|
2023-09-13 00:38:24 +00:00
|
|
|
RUN chmod +x /init_portainer
|
2023-09-11 00:40:56 +00:00
|
|
|
|
2023-10-18 09:21:53 +00:00
|
|
|
|
2023-10-17 09:42:38 +00:00
|
|
|
# step2: Copy build go program to portainer
|
2023-10-17 06:42:09 +00:00
|
|
|
# Dockerfile refer to: https://github.com/portainer/portainer/blob/develop/build/linux/Dockerfile
|
2024-07-25 01:02:59 +00:00
|
|
|
FROM portainer/portainer-ce:2.20.3
|
2023-09-18 01:31:29 +00:00
|
|
|
LABEL maintainer="websoft9<help@websoft9.com>"
|
2024-07-25 01:02:59 +00:00
|
|
|
LABEL version="2.20.3"
|
2023-09-19 08:28:36 +00:00
|
|
|
COPY --from=builder /init_portainer /
|
2023-09-23 02:41:35 +00:00
|
|
|
|
2024-07-25 00:39:06 +00:00
|
|
|
ENTRYPOINT ["/init_portainer"]
|