From c3daaace0828b683262788a2f7ce142e3b0b4b77 Mon Sep 17 00:00:00 2001 From: Zhao Zuohong Date: Sat, 9 Dec 2023 22:50:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E7=94=A8=E4=B8=A4=E9=98=B6=E6=AE=B5?= =?UTF-8?q?=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .woodpecker.yml | 23 +++++++---------------- Dockerfile | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+), 16 deletions(-) create mode 100644 Dockerfile diff --git a/.woodpecker.yml b/.woodpecker.yml index d9853d0..3a1e2a9 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,22 +1,13 @@ steps: build: - image: almalinux:9 + image: docker commands: - - dnf -y install dnf-plugin-config-manager - - dnf config-manager --set-enabled crb - - dnf -y install epel-release buildah - - echo 'unqualified-search-registries = ["docker.io"]' > /etc/containers/registries.conf - - export microcontainer=$(buildah from almalinux/9-micro) - - export micromount=$(buildah mount $microcontainer) - - dnf install --installroot $micromount --releasever 9 --setopt install_weak_deps=false --nodocs -y nodejs git-tools - - dnf clean all --installroot $micromount - - wget https://github.com/jgm/pandoc/releases/download/3.1.9/pandoc-3.1.9-linux-amd64.tar.gz - - tar xvf pandoc-3.1.9-linux-amd64.tar.gz - - cp pandoc-3.1.9/bin/pandoc $micromount/usr/bin/ - - buildah unmount $microcontainer - - buildah commit $microcontainer git.zhaozuohong.vip/zhao/node-pandoc - - buildah login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD git.zhaozuohong.vip - - buildah push git.zhaozuohong.vip/zhao/node-pandoc + - docker build . --rm -t git.zhaozuohong.vip/zhao/node-pandoc + - docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD git.zhaozuohong.vip + - docker push git.zhaozuohong.vip/zhao/node-pandoc + - docker rmi git.zhaozuohong.vip/zhao/node-pandoc + volumes: + - /var/run/docker.sock:/var/run/docker.sock secrets: - registry_username - registry_password diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3544f24 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM almalinux:9 as installer + +RUN dnf -y install dnf-plugin-config-manager \ + && dnf config-manager --set-enabled crb \ + && dnf -y install epel-release +RUN dnf install \ + --installroot /fakeroot \ + --releasever 9 \ + --setopt install_weak_deps=false \ + --nodocs -y \ + nodejs npm git-tools \ + && dnf clean all --installroot /fakeroot +RUN curl -L -o pandoc-3.1.9.tar.gz https://github.com/jgm/pandoc/releases/download/3.1.9/pandoc-3.1.9-linux-amd64.tar.gz \ + && tar -xvf pandoc-3.1.9.tar.gz \ + && cp pandoc-3.1.9/bin/pandoc /fakeroot/usr/local/bin/pandoc + + +FROM scratch +COPY --from=installer /fakeroot / +RUN npm install -g pnpm \ + && npm cache clean --force