portainer image

This commit is contained in:
qiaofeng1227 2023-09-11 08:40:56 +08:00
parent 28a2a55376
commit 1517550430
2 changed files with 12 additions and 10 deletions

View file

@ -0,0 +1,10 @@
# step1: build entrypoint execute program init_portainer by golang
FROM golang:latest AS builder
WORKDIR /
COPY init_portainer.go /init_portainer.go
RUN go build -o init_portainer init_portainer.go
RUN chmod +x ./init_portainer
# step2: copy build go program to portainer
FROM portainer/portainer-ce:2.19.0
COPY --from=builder /init_portainer /

View file

@ -6,17 +6,9 @@ services:
portainer:
container_name: websoft9-portainer
build:
image: websoft9dev/portainer
context: .
dockerfile_inline: |
# step1: build entrypoint execute program init_portainer by golang
FROM golang:latest AS builder
WORKDIR /
COPY init_portainer.go /init_portainer.go
RUN go build -o init_portainer init_portainer.go
RUN chmod +x ./init_portainer
# step2: copy build go program to portainer
FROM portainer/portainer-ce:2.19.0
COPY --from=builder /init_portainer /
dockerfile: Dockerfile
entrypoint: ["/init_portainer"]
restart: unless-stopped
volumes: