diff --git a/jenkins/docker-compose.yml b/jenkins/docker-compose.yml index 39f7431..bb0bc72 100644 --- a/jenkins/docker-compose.yml +++ b/jenkins/docker-compose.yml @@ -1,5 +1,8 @@ services: jenkins: + build: + context: . # Ścieżka do katalogu, w którym znajduje się Dockerfile + dockerfile: dockerfile image: jenkins-with-docker container_name: jenkins env_file: diff --git a/jenkins/dockerfile b/jenkins/dockerfile index 61291af..0f8de26 100644 --- a/jenkins/dockerfile +++ b/jenkins/dockerfile @@ -1,17 +1,11 @@ -FROM jenkins/jenkins:lts-jdk17 - + # docker build --file 1.jenkins-with-docker-Dockerfile -t jenkins-with-docker . + +FROM jenkins/jenkins:lts-jdk17 USER root - -# Instalacja Docker, Maven, Node.js i innych narzędzi w jednym kroku -RUN apt-get update && apt-get -qy full-upgrade && \ - apt-get install -qy curl maven && \ - curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \ - apt-get install -qy nodejs && \ - curl -fsSL https://get.docker.com/ | sh && \ - 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 +RUN apt-get update && \ + apt-get -qy full-upgrade && \ + apt-get install -qy curl && \ + curl -sSL https://get.docker.com/ | sh +RUN apt-get install -y maven +RUN apt install nodejs -y +RUN git config --global --add safe.directory '*' \ No newline at end of file