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
|
2022-01-30 17:21:43 +01:00
|
|
|
docker run -d -p 8080:8080 docker_sample
|
2020-05-27 22:01:26 +02:00
|
|
|
# and the server should start instantly
|
2022-01-30 17:21:43 +01:00
|
|
|
curl http://localhost:8080
|
2020-05-27 22:01:26 +02:00
|
|
|
```
|
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
|
2022-01-30 17:21:43 +01:00
|
|
|
docker build -t docker_sample:test .
|
2020-05-27 22:01:26 +02:00
|
|
|
docker run --rm docker_sample:test
|
|
|
|
```
|