From 151755043046e7098828cb10f0de1dd935eb8881 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Mon, 11 Sep 2023 08:40:56 +0800 Subject: [PATCH] portainer image --- docker/w9portainer/Dockerfile | 10 ++++++++++ docker/w9portainer/docker-compose.yml | 12 ++---------- 2 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 docker/w9portainer/Dockerfile diff --git a/docker/w9portainer/Dockerfile b/docker/w9portainer/Dockerfile new file mode 100644 index 00000000..4730c7cd --- /dev/null +++ b/docker/w9portainer/Dockerfile @@ -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 / \ No newline at end of file diff --git a/docker/w9portainer/docker-compose.yml b/docker/w9portainer/docker-compose.yml index 911431a3..a6289bd5 100644 --- a/docker/w9portainer/docker-compose.yml +++ b/docker/w9portainer/docker-compose.yml @@ -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: