Page tree

Michael O'Brien

Skip to end of metadata
Go to start of metadata

Running Docker in the Cloud

There are multiple ways of running docker in the cloud.  This list is in order of management (cloud managed at the top)

per host

Docker under a Cloud Managed Kubernetes service on Managed VM infrastructureEKS FargateManagedManaged
serverlessManaged$144 US/month for control plane
+ EC2 cost

Docker under a Cloud Managed Kubernetes service on client managed VM infrastructureEKS EC2managedunmanaged
EC2 cost

Docker under a Cloud Managed Docker service on Managed VM InfrastructureECS Fargatemanagedmanaged

Docker on ECS on EC2 instances (in a Auto Scaling Group)ECS EC2managedunmanaged
EC2 cost + NLB

Docker on Elastic BeanstalkElastic Beanstalkmanagedunmanaged

RKE Rancher Kubernetes EngineEC2unmanagedunmanaged

Docker on single EC2sEC2unmanagedunmanaged

Running Docker in AWS

Running Docker in Azure

Docker Installation

see Kubernetes Developer Guide#DockerInstallation

Docker Run

docker run -p 8080:8080 -p 8001:8001 -d --name drools-workbench jboss/drools-workbench-showcase:latest
docker run -p 8180:8080 -d --name kie-server --link drools-workbench:kie-wb jboss/kie-server-showcase:latest

Docker Pull

Check your login first

obrienlabs:devops michaelobrien$ docker login
Authenticating with existing credentials...
Login Succeeded

Docker Exec

Docker History

Docker log

docker logs -f testconfig_aai-resources.api.simpledemo.openecomp.org_1

Docker Build

docker build -t -f Dockerfile .

Step 29/29 : ENTRYPOINT usr/local/bin/

 ---> Using cache

 ---> d3cf07a80918

Successfully built d3cf07a80918

Successfully tagged

obrienbiometrics:pgaas michaelobrien$ docker images

REPOSITORY                                   TAG                 IMAGE ID            CREATED             SIZE   latest              d3cf07a80918        9 minutes ago       1.03GB

Docker Registry Image Search

where the image name is "dcae-controller"

obrienbiometrics:pgaas michaelobrien$ curl -Ss -u docker:docker | jq


  "name": "dcae-controller",

  "tags": [




Docker Push


root@obriensystemskub0:~/oom/kubernetes/dcae/pgaas# export DOCKER_ID_USER="obrienlabs"
root@obriensystemskub0:~/oom/kubernetes/dcae/pgaas# docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to to create one.
Username: obrienlabs
Login Succeeded
root@obriensystemskub0:~/oom/kubernetes/dcae/pgaas# docker build -t obrienlabs/pgaas -f Dockerfile .
Sending build context to Docker daemon 23.55 kB
Step 1 : FROM ubuntu:16.04
 ---> d355ed3537e9
Successfully built 257430a38254
root@obriensystemskub0:~/oom/kubernetes/dcae/pgaas# docker tag obrienlabs/pgaas obrienlabs/pgaas:1
root@obriensystemskub0:~/oom/kubernetes/dcae/pgaas# docker push  obrienlabs/pgaas:1
The push refers to a repository []
ee716c896001: Pushed
....5a4c2c9a24fc: Pushed
cb11ba605400: Pushed
1: digest: sha256:fb09855b323fe83aaa161725910cd2f6d7ff6306035e6f5f2df40b99149e8fed size: 6157

pull on separate machine
obrienbiometrics:oom michaelobrien$ docker pull obrienlabs/pgaas:1
1: Pulling from obrienlabs/pgaas
23a6960fe4a9: Extracting [===>                                               ]  3.441MB/45.89MB
e9e104b0e69d: Download complete
cd33d2ea7970: Download complete
534ff7b7d120: Download complete

Docker save/load

Docker cleanup

Docker full system prune

$ docker system df
TYPE                TOTAL               ACTIVE              SIZE                RECLAIMABLE
Images              41                  13                  9.123GB             4.001GB (43%)
Containers          24                  22                  4.823GB             4.823GB (99%)
Local Volumes       8                   1                   8.316GB             2.904GB (34%)
Build Cache         0                   0                   0B                  0B

$ docker system prune -a                                                                                                                                                             WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all images without at least one container associated to them
  - all build cache
Total reclaimed space: 13.19GB
$ docker system df
TYPE                TOTAL               ACTIVE              SIZE                RECLAIMABLE
Images              11                  11                  757.9MB             48.46MB (6%)
Containers          22                  22                  6.017kB             0B (0%)
Local Volumes       8                   0                   8.316GB             8.316GB (100%)
Build Cache         0                   0                   0B                  0B

Stop all containers

docker stop  $(docker ps -a -q)

Remove all containers

docker rm $(docker ps -a -f status=exited -q)

Remove all images

docker rmi $(docker images -a -q) --force

Remove all volumes

docker volume rm $(docker volume ls)

Updating WARs/JARs

Attaching to a Debug Port


List Docker Mounts


Docker fails to start on OSX

reset to defaults

Docker in Docker


Run an Ubuntu Desktop container on Docker - for nested Docker

We used this one in ONAP - it needs a volume - so we will likely need do dockerfile it - to save state - if you dont

 have local drive share capability from Docker Desktop. Goto

docker run -p 6080:80 -d --name ubuntu dorowu/ubuntu-desktop-lxde-vnc
# test a file copy
docker cp pom.xml ubuntu:/root/pom.xml

# check it
docker exec -it ubuntu bash
root@6950d3be0f24:/root# ls
Desktop  pom.xml

Network Connections to Other Docker Containers on the same Host

localhost won't work inside a container - it just resolves to itself - use a network or the following URLs

in mac


in windows or both


Docker Images by Language







  • No labels