Tweaks
This commit is contained in:
59
README.md
Normal file
59
README.md
Normal file
@ -0,0 +1,59 @@
|
||||
## 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
|
||||
```
|
||||
@ -1,6 +1,7 @@
|
||||
IMAGE_NAME=api-server
|
||||
CONTAINER_NAME=api-server
|
||||
|
||||
|
||||
build: clean
|
||||
@docker build \
|
||||
--progress=plain \
|
||||
@ -8,6 +9,7 @@ build: clean
|
||||
--tag $(IMAGE_NAME) \
|
||||
.
|
||||
|
||||
|
||||
run:
|
||||
@docker run \
|
||||
--name $(IMAGE_NAME) \
|
||||
@ -16,6 +18,7 @@ run:
|
||||
--detach \
|
||||
$(CONTAINER_NAME)
|
||||
|
||||
|
||||
run-mount-log:
|
||||
@docker run \
|
||||
--name $(IMAGE_NAME) \
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,12 +1,14 @@
|
||||
IMAGE_NAME=api-server-ms
|
||||
CONTAINER_NAME=api-server-ms
|
||||
|
||||
|
||||
build: clean
|
||||
@docker build \
|
||||
--progress=plain \
|
||||
--tag $(IMAGE_NAME) \
|
||||
.
|
||||
|
||||
|
||||
build-multistage: clean
|
||||
@docker build \
|
||||
--progress=plain \
|
||||
@ -14,6 +16,7 @@ build-multistage: clean
|
||||
--file Dockerfile.multistage \
|
||||
.
|
||||
|
||||
|
||||
run:
|
||||
@docker run \
|
||||
--name $(IMAGE_NAME) \
|
||||
@ -22,6 +25,7 @@ run:
|
||||
--detach \
|
||||
$(CONTAINER_NAME)
|
||||
|
||||
|
||||
clean:
|
||||
- @docker stop $(CONTAINER_NAME)
|
||||
- @docker rm $(CONTAINER_NAME)
|
||||
|
||||
Reference in New Issue
Block a user