2020-05-27 22:01:26 +02:00
|
|
|
# Docker sample
|
2020-02-24 18:48:04 +01:00
|
|
|
|
2020-05-27 22:01:26 +02:00
|
|
|
## Build image
|
2020-02-24 18:48:04 +01:00
|
|
|
|
|
|
|
```shell
|
2020-05-27 22:01:26 +02:00
|
|
|
docker build -t docker_sample .
|
2020-02-24 18:48:04 +01:00
|
|
|
```
|
|
|
|
|
2020-05-27 22:01:26 +02:00
|
|
|
## Run built image
|
2020-02-24 18:48:04 +01:00
|
|
|
|
|
|
|
```shell
|
2020-05-27 22:01:26 +02:00
|
|
|
docker run -d -p 5000:5000 docker_sample
|
|
|
|
# and the server should start instantly
|
|
|
|
curl http://localhost:5000
|
|
|
|
```
|
2020-02-24 18:48:04 +01:00
|
|
|
|
2020-05-27 22:01:26 +02:00
|
|
|
## Running unit tests
|
2020-02-24 18:48:04 +01:00
|
|
|
|
2020-05-27 22:01:26 +02:00
|
|
|
```shell
|
|
|
|
docker build -t docker_sample:test --target base .
|
|
|
|
docker run --rm docker_sample:test
|
|
|
|
```
|