https://github.com/bryik/docker-example
A small Dockerized Python app for example purposes.
https://github.com/bryik/docker-example
docker python
Last synced: 3 months ago
JSON representation
A small Dockerized Python app for example purposes.
- Host: GitHub
- URL: https://github.com/bryik/docker-example
- Owner: bryik
- Created: 2019-05-02T01:21:11.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-02T01:21:15.000Z (about 7 years ago)
- Last Synced: 2026-01-02T12:37:06.666Z (7 months ago)
- Topics: docker, python
- Language: Dockerfile
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# writing-docker-example
This repo is an example of a toy Docker application used in the blog post "Writing Dockerfiles".
## How to use
After cloning the repo, open a terminal in the root directory and then run:
```bash
docker-compose up
```
The image should build and then run:
```bash
Attaching to docker-example_scraper_1
scraper_1 |
scraper_1 |
scraper_1 | Example Domain
scraper_1 | This domain is established to be used for illustrative examples in documents. You may use this
scraper_1 | domain in examples without prior coordination or asking for permission.
scraper_1 |
scraper_1 |
scraper_1 |
docker-example_scraper_1 exited with code 0
```
## Other commands
### Building the image
```bash
docker build -t names-are-hard .
```
### Running the image
```bash
docker run names-are-hard
```
### Interactive mode
This command runs the image, but instead of executing `main.py` you will be dropped into a bash prompt inside the container. This is very useful for testing commands before committing them to a Dockerfile.
```bash
docker run -it names-are-hard bash
```
From the bash prompt, try `ls`. What files do you see?
To **exit** the prompt, hit `CTRL-D`.