60 lines
1.3 KiB
Markdown
60 lines
1.3 KiB
Markdown
## Uvod
|
|
|
|
- Docker je platforma za development, delivery i izvršavanje aplikacija
|
|
- Docker omogućava da se aplikacija izolira u repetativnoj okolini i odvoji od infrastrukture
|
|
|
|
[Features of Docker](https://www.geeksforgeeks.org/features-of-docker/):
|
|
- Open-source platform
|
|
- An Easy, lightweight, and consistent way of delivery of applications
|
|
- Fast and efficient development life cycle
|
|
- Segregation of duties
|
|
- Service-oriented architecture
|
|
- Security
|
|
- Scalability
|
|
- Reduction in size
|
|
- Image management
|
|
- Networking
|
|
- Volume management
|
|
|
|
|
|
## Struktura
|
|
|
|
- Dockerfile
|
|
- image
|
|
- container registry
|
|
- lokalni
|
|
- dockerhub
|
|
- AWS ECR
|
|
- container
|
|
|
|
|
|
## Dockerfile
|
|
|
|
- base image
|
|
- odabir najmanjeg funkcionalnog
|
|
- debian prije ubuntua
|
|
- debian-slim prije debiana
|
|
- alpine
|
|
- from scratch
|
|
- env varijable
|
|
|
|
|
|
## Docker image
|
|
|
|
- single stage build
|
|
- multistage build
|
|
|
|
|
|
## Docker container
|
|
|
|
run:
|
|
```
|
|
docker run --name api-server-3000 --publish 3000:3000 --env CONTAINER_NAME="Awesome API server on port 3000" -d api-server
|
|
```
|
|
```
|
|
docker run --name api-server-3001 --publish 3001:3000 --env CONTAINER_NAME="Awesome API server on port 3001" -d api-server
|
|
```
|
|
```
|
|
docker run --name api-server-3002 --publish 3002:3000 --env CONTAINER_NAME="Awesome API server on port 3002" -d api-server
|
|
```
|