From 722c956e1f1c10c112c627e3cf55cd55eaccd515 Mon Sep 17 00:00:00 2001 From: Witalij Poljatchek Date: Tue, 9 Jan 2024 17:16:07 +0100 Subject: [PATCH] conf docker jenkins --- Dockerfile | 18 ++++-------------- Dockerfile copy | 15 +++++++++++++++ Dockerfile copy 2 | 12 ++++++++++++ Dockerfile.inbound | 15 +++++++++++++++ Dockerfile.test | 13 +++++++++++++ 5 files changed, 59 insertions(+), 14 deletions(-) create mode 100644 Dockerfile copy create mode 100644 Dockerfile copy 2 create mode 100644 Dockerfile.inbound create mode 100644 Dockerfile.test diff --git a/Dockerfile b/Dockerfile index d211e44..6eef6bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,5 @@ -FROM jenkins/inbound-agent +FROM node:21-bookworm AS build -USER root - -RUN apt-get update ;\ - apt-get -y install lsb-release procps wget sudo git apt-transport-https ca-certificates curl gnupg2 software-properties-common - -RUN curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg ;\ - echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian bookworm stable" | sudo tee /etc/apt/sources.list.d/docker.list ;\ - apt-get update ;\ - apt-get -y install docker-ce docker-ce-cli docker-ce-rootless-extras docker-buildx-plugin - -RUN sudo curl -sL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh ;\ - sudo bash nodesource_setup.sh ;\ - apt-get -y install nodejs \ No newline at end of file +RUN node -v +WORKDIR /app +COPY . . \ No newline at end of file diff --git a/Dockerfile copy b/Dockerfile copy new file mode 100644 index 0000000..9779cd8 --- /dev/null +++ b/Dockerfile copy @@ -0,0 +1,15 @@ +FROM ubuntu:22.04 + +USER root + +RUN apt-get update ;\ + apt-get -y install lsb-release procps wget sudo git apt-transport-https ca-certificates curl gnupg2 software-properties-common + +RUN curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg ;\ + echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian bookworm stable" | sudo tee /etc/apt/sources.list.d/docker.list ;\ + apt-get update ;\ + apt-get -y install docker-ce docker-ce-cli docker-ce-rootless-extras docker-buildx-plugin + +RUN sudo curl -sL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh ;\ + sudo bash nodesource_setup.sh ;\ + apt-get -y install nodejs diff --git a/Dockerfile copy 2 b/Dockerfile copy 2 new file mode 100644 index 0000000..21b89f3 --- /dev/null +++ b/Dockerfile copy 2 @@ -0,0 +1,12 @@ +FROM node:21-bookworm AS build + +RUN node -v +WORKDIR /app +COPY . . +RUN npm install +RUN npm run build + +FROM nginx +COPY --from=build /app/dist/ /usr/share/nginx/html/ +RUN rm /etc/nginx/conf.d/default.conf +COPY _nginx/nginx.conf /etc/nginx/conf.d \ No newline at end of file diff --git a/Dockerfile.inbound b/Dockerfile.inbound new file mode 100644 index 0000000..d211e44 --- /dev/null +++ b/Dockerfile.inbound @@ -0,0 +1,15 @@ +FROM jenkins/inbound-agent + +USER root + +RUN apt-get update ;\ + apt-get -y install lsb-release procps wget sudo git apt-transport-https ca-certificates curl gnupg2 software-properties-common + +RUN curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg ;\ + echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian bookworm stable" | sudo tee /etc/apt/sources.list.d/docker.list ;\ + apt-get update ;\ + apt-get -y install docker-ce docker-ce-cli docker-ce-rootless-extras docker-buildx-plugin + +RUN sudo curl -sL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh ;\ + sudo bash nodesource_setup.sh ;\ + apt-get -y install nodejs \ No newline at end of file diff --git a/Dockerfile.test b/Dockerfile.test new file mode 100644 index 0000000..f6deff2 --- /dev/null +++ b/Dockerfile.test @@ -0,0 +1,13 @@ +FROM jenkins/inbound-agent + +USER root +RUN apt-get update ;\ + apt-get -y install npm procps wget sudo git apt-transport-https ca-certificates curl gnupg2 software-properties-common ;\ + curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker.gpg ;\ + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable" |tee /etc/apt/sources.list.d/docker.list > /dev/null ;\ + apt-get -y update ;\ + apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-compose + +RUN sudo curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - && sudo apt install nodejs -y + +USER jenkins \ No newline at end of file