32 lines
900 B
Markdown
32 lines
900 B
Markdown
# Hello World in Docker
|
|
|
|
## Bash
|
|
```bash
|
|
docker buildx build -t hello-world-bash -f Dockerfile.bash .
|
|
docker run --rm --name "helloWorldBash" hello-world-bash
|
|
```
|
|
|
|
## Python
|
|
```bash
|
|
docker buildx build -t hello-world-python -f Dockerfile.python .
|
|
docker run --rm -it --name "helloWorldPython" hello-world-python
|
|
```
|
|
|
|
## Python in Alpine
|
|
```bash
|
|
docker buildx build -t hello-world-python-alpine -f Dockerfile.python-alpine .
|
|
docker run --rm -it --name "helloWorldPythonAlpine" hello-world-python-alpine
|
|
```
|
|
|
|
# Let's see how much space each image takes up
|
|
```bash
|
|
docker images
|
|
```
|
|
|
|
```bash
|
|
REPOSITORY TAG IMAGE ID CREATED SIZE
|
|
hello-world-bash latest 7fab71e07670 21 seconds ago 101MB
|
|
hello-world-python-alpine latest e42435db8b4a 30 minutes ago 53.4MB
|
|
hello-world-python latest 9fe43bb44dca 47 minutes ago 1GB
|
|
```
|