2020-01-07 09:32:27 +00:00
|
|
|
# Docker
|
2020-01-07 09:22:41 +00:00
|
|
|
|
2020-01-07 11:14:08 +00:00
|
|
|
Dockerfile and compose files used as basis for service deployment.
|
2020-01-16 14:09:47 +00:00
|
|
|
|
|
|
|
## Build and push an image
|
|
|
|
|
|
|
|
Build the image.
|
|
|
|
```
|
2020-01-24 10:34:16 +00:00
|
|
|
$ docker build -t [registryUrl]/[imageName]:[tag] [folder]
|
2020-01-16 14:09:47 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Login into docker registry.
|
|
|
|
```
|
|
|
|
$ docker login [registryUrl]
|
|
|
|
```
|
|
|
|
|
|
|
|
Push the image.
|
|
|
|
```
|
|
|
|
$ docker push [registryUrl]/[imageName]:[tag]
|
|
|
|
```
|
|
|
|
|
2020-01-24 10:55:05 +00:00
|
|
|
Logout from docker registry (If you don't logout, credentials will remain saved
|
|
|
|
in your home directory).
|
2020-01-16 14:09:47 +00:00
|
|
|
```
|
|
|
|
$ docker logout [registryUrl]
|
|
|
|
```
|
2020-04-16 19:40:49 +00:00
|
|
|
|
|
|
|
## Test image locally
|
|
|
|
|
|
|
|
```
|
|
|
|
$ docker run -d --name [containerName] [registryUrl]/[imageName]:[tag]
|
|
|
|
```
|
|
|
|
|