Свой Dockerfile для каждой версии образа

This commit is contained in:
Valentin Silyutin
2025-12-03 01:03:18 +04:00
parent a0ac6ec9e0
commit 35497114b4
5 changed files with 20 additions and 5 deletions

3
18.17/1.0.1/Dockerfile Normal file
View File

@@ -0,0 +1,3 @@
FROM node:18.17-alpine3.18
RUN apk add --no-cache git openjdk17-jre-headless
CMD ["/bin/sh"]

3
18.17/1.0.2/Dockerfile Normal file
View File

@@ -0,0 +1,3 @@
FROM node:18.17-alpine3.18
RUN apk add --no-cache git openjdk17-jre-headless openssh
CMD ["/bin/sh"]

3
20.12/1.0.0/Dockerfile Normal file
View File

@@ -0,0 +1,3 @@
FROM node:20.12-alpine3.19
RUN apk add --no-cache git openjdk17-jre-headless openssh
CMD ["/bin/sh"]

View File

@@ -1,5 +1,11 @@
## Сборка нового образа
1. Создать папку с номером версии Node.js, а в ней - папку с номером версии образа
2. Добавить Dockerfile
3. Собрать образ и отправить его в репозиторий:
``` ```
docker build -t gitea.optiweb.ru/public/node:18.17-1.0.0 -t gitea.optiweb.ru/public/node:latest . docker build -t gitea.optiweb.ru/public/node:18.17-1.0.0 -t gitea.optiweb.ru/public/node:latest .
docker push gitea.optiweb.ru/public/node:18.17-1.0.0 docker push gitea.optiweb.ru/public/node:18.17-1.0.0
docker push gitea.optiweb.ru/public/node:latest docker push gitea.optiweb.ru/public/node:latest
``` ```
4. Отправить коммит с новым Dockerfile в репозиторий (`git commit -m "18.17-1.0.0"`)