Adding node to jenkins

This commit is contained in:
Artur 2025-01-07 13:37:24 +01:00
parent 51a9a7c7b7
commit ac4d5189df
2 changed files with 13 additions and 16 deletions

View File

@ -1,5 +1,8 @@
services: services:
jenkins: jenkins:
build:
context: . # Ścieżka do katalogu, w którym znajduje się Dockerfile
dockerfile: dockerfile
image: jenkins-with-docker image: jenkins-with-docker
container_name: jenkins container_name: jenkins
env_file: env_file:

View File

@ -1,17 +1,11 @@
# docker build --file 1.jenkins-with-docker-Dockerfile -t jenkins-with-docker .
FROM jenkins/jenkins:lts-jdk17 FROM jenkins/jenkins:lts-jdk17
USER root USER root
RUN apt-get update && \
# Instalacja Docker, Maven, Node.js i innych narzędzi w jednym kroku apt-get -qy full-upgrade && \
RUN apt-get update && apt-get -qy full-upgrade && \ apt-get install -qy curl && \
apt-get install -qy curl maven && \ curl -sSL https://get.docker.com/ | sh
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \ RUN apt-get install -y maven
apt-get install -qy nodejs && \ RUN apt install nodejs -y
curl -fsSL https://get.docker.com/ | sh && \ RUN git config --global --add safe.directory '*'
git config --global --add safe.directory '*'
# Sprawdzenie zainstalowanych wersji
RUN node -v && npm -v && docker -v && mvn -v
# Domyślnie przełącz na użytkownika Jenkins
USER jenkins