https://github.com/adamdawi/multi-stage-docker-nginx-ghcr-l6
Docker-based web app with a multi-stage build using Nginx. Demonstrates GitHub CLI usage (gh), SSH-based repo cloning inside Dockerfiles, BuildKit frontend configuration, and image publishing to ghcr.io with public visibility.
https://github.com/adamdawi/multi-stage-docker-nginx-ghcr-l6
buildkit docker frontend-build ghcr github-cli multi-stage-build nginx ssh web-application
Last synced: 4 months ago
JSON representation
Docker-based web app with a multi-stage build using Nginx. Demonstrates GitHub CLI usage (gh), SSH-based repo cloning inside Dockerfiles, BuildKit frontend configuration, and image publishing to ghcr.io with public visibility.
- Host: GitHub
- URL: https://github.com/adamdawi/multi-stage-docker-nginx-ghcr-l6
- Owner: AdamDawi
- Created: 2025-04-05T08:46:13.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2025-04-08T18:56:58.000Z (6 months ago)
- Last Synced: 2025-06-25T10:07:43.741Z (4 months ago)
- Topics: buildkit, docker, frontend-build, ghcr, github-cli, multi-stage-build, nginx, ssh, web-application
- Language: JavaScript
- Homepage:
- Size: 3.6 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Lab 6 — Docker, BuildKit & GitHub CLI
[🇬🇧 English](#english-version) | [🇵🇱 Polski](#wersja-polska)
---
## English version
### Part 1
#### Git initialization
#### Creating a public repository using the GitHub CLI
```bash
gh repo create pawcho6 --public --source=. --remote=origin --push
```
#### Changes in `Dockerfile_stage_1_and_2`
SSH support and cloning of a private repository have been added. See `Dockerfile_stage_1_and_2` for full modifications.---
### Part 2
#### Enabling BuildKit
```bash
set DOCKER_BUILDKIT=1
```
#### Building the image
```bash
docker build --ssh default -f Dockerfile_stage_1_and_2 -t ghcr.io/adamdawi/pawcho6:lab6 .
```
#### Confirming the image build
#### Pushing the image
```bash
docker push ghcr.io/adamdawi/pawcho6:lab6
```
The image visibility has been changed from private to public and linked to the repository. It’s available under the **Packages** tab.
#### Running the container
```bash
docker run -d --rm --name lab6_test -p 80:80 ghcr.io/adamdawi/pawcho6:lab6
```
#### Viewing running containers
```bash
docker ps
```
#### Example output:
#### Screenshot of the running web app:
---
## Wersja polska
### Część 1
#### Inicjalizacja git
#### Stworzenie publicznego repozytorium z użyciem programu gh
```bash
gh repo create pawcho6 --public --source=. --remote=origin --push
```
#### Wprowadzenie zmian w `Dockerfile_stage_1_and_2`
Dodano obsługę SSH i klonowanie prywatnego repozytorium. Zmiany można zobaczyć w pliku `Dockerfile_stage_1_and_2`.---
### Część 2
#### Włączenie BuildKit
```bash
set DOCKER_BUILDKIT=1
```
#### Zbudowanie obrazu
```bash
docker build --ssh default -f Dockerfile_stage_1_and_2 -t ghcr.io/adamdawi/pawcho6:lab6 .
```
#### Potwierdzenie zbudowania obrazu
#### Wysłanie obrazu
```bash
docker push ghcr.io/adamdawi/pawcho6:lab6
```
Widoczność wysłanego obrazu została zmieniona z `private` na `public` i przypisana do repozytorium. Obraz można zobaczyć w zakładce **Packages**.
#### Polecenie do uruchomienia kontenera:
```bash
docker run -d --rm --name lab6_test -p 80:80 ghcr.io/adamdawi/pawcho6:lab6
```
#### Polecenie do wyświetlenia uruchomionych kontenerów:
```bash
docker ps
```
#### Wynik działania polecenia `ps`:
#### Zdjęcie pokazujące działanie aplikacji webowej:
