https://github.com/aksbuzz/docker-learn
Repo to learn docker
https://github.com/aksbuzz/docker-learn
Last synced: about 1 month ago
JSON representation
Repo to learn docker
- Host: GitHub
- URL: https://github.com/aksbuzz/docker-learn
- Owner: aksbuzz
- Created: 2023-12-02T13:38:55.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-06T16:29:02.000Z (over 2 years ago)
- Last Synced: 2025-12-29T05:52:51.956Z (5 months ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# docker-learn
Repo to learn docker
## Access containers from host system
Docker container will expose ports which can be used to access
the app.
- To expose, we have to publish these ports when creating contaienr
using --publish (-p) option
```-p :```
Example
```docker run --publish 80:80 examplename/examplerepository-server:0.1.0```
## Volumes
Data that is stored inside a container is not persisted by default.
When you stop and remove a container, all data from this container is lost.
There are two different volume types:
1. named volumes - handled by docker
2. mounted volumes - handled by you
```--volume (shorthand -v)```
Named
```-v :/path/in/container```
Mounted
```-v /path/on/host:/path/in/container```
Example
```docker run -v server-volume:/app/build/data -p 80:80 app-server:0.1.0```