Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mdpiper/hello-docker
An example of setting up a simple Docker image
https://github.com/mdpiper/hello-docker
Last synced: 13 days ago
JSON representation
An example of setting up a simple Docker image
- Host: GitHub
- URL: https://github.com/mdpiper/hello-docker
- Owner: mdpiper
- License: mit
- Created: 2020-12-02T21:51:34.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-08-29T16:32:53.000Z (4 months ago)
- Last Synced: 2024-08-30T00:43:09.731Z (4 months ago)
- Language: HTML
- Size: 10.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hello-docker
A simple example of setting up, building, and running a Docker image.
The Dockerfile contains instructions for
configuring a web server in Python
to display a web page.Build the image from the Dockerfile with:
```
docker build --tag hello-docker .
```Launch a container from the image with:
```
docker run --publish 8080:80 --detach --name hiya hello-docker
```
Because `--detach` is set, the container runs in the background.
The container is named "hiya".
Port 8080 on the local machine is mapped to port 80 in the container.To view the exciting result of running this container, open
http://[::]:8080/ (or http://localhost:8080)
in a web browser on your local machine.Stop the container and remove it with:
```
docker container stop hiya
docker container rm hiya
```## Automatically build and push image
I set up a CI workflow in [release.yml](./.github/workflows/release.yml)
to build the *hellow-docker* image and push it to Docker Hub.
The workflow only runs when the repo is tagged.
Just push the tag to GitHub and the workflow handles the rest.