Docker Useful Commands

# Create a better hyperv machine
docker-machine create -d hyperv --hyperv-cpu-count 2 --hyperv-memory 2048 --hyperv-virtual-switch "ExternalSwitch" default

# Build Docker Image and removing intermediate container
docker build --rm -t myimage .

# Running docker container in the background with multiple ports open
docker run -d -p 8080:8080 -p 5687:5678 puckel/docker-airflow
# Running docker container interactively
docker run -p 127.0.0.1:5678:5678 -it testpython
# Compose docker containers with recreating always
docker-compose -f test.yml up --force-recreate

# Sudoing under docker ssh
sudo -i
Advertisements