Skip to content

Instantly share code, notes, and snippets.

@dylanyoung-dev
Last active April 27, 2021 05:07
Show Gist options
  • Save dylanyoung-dev/ba06e4761644726b9242e2796ea77960 to your computer and use it in GitHub Desktop.
Save dylanyoung-dev/ba06e4761644726b9242e2796ea77960 to your computer and use it in GitHub Desktop.
Docker Cheatsheet for getting setup with Sitecore Docker folder and then how to manage my docker images locally.
## Sitecore Docker Repository (Clone Locally)
git clone https://github.com/Sitecore/docker-images/
## Change Directory to Root of Cloned Repository
cd docker-images
## Run Build.ps1 (with default tags)
.\Build.ps1
## Set Path for License File
.\Set-LicenseEnvironmentVariable.ps1 -Path D:\license\license.xml
## Change to 9.3 folder to run Docker Compose
cd .\windows\tests\9.3.x
## Compose Docker Sitecore Containers (Takes list of Images and starts Containers)
docker-compose -f .\docker-compose.xp.yml up
## Stop Docker Sitecore Containers (Takes list of Containers and turns them off)
docker-compose -f .\docker-compose.xp.yml down
## Lists currently running containers
docker container ls
## Lists all images locally available
docker image ls
docker images
## Lists Volumes
docker volume ls
## Lists Networks
docker network ls
## Remove all unused containers (all stopped containers, all networks not used by at least one container, all dangling images, all build cache)
docker system prune
## Remove all unused volumes
docker system prune --volumes
## Remove a Docker Container by ID (use `docker container ls -a` to get list of container IDs)
docker container rm <ID>
## Remove a Docker Image by Id (use `dockmer image ls` to get list with ID's)
docker image rm <ID>
#Removes (and un-tags) all images from the host node (--force to force removal)
docker rmi $(docker images -a -q)
## After you run a docker topology, you should clean data folder (.\Clean-Data.ps1 that's in the windows\tests\9.3.0 folder)
~\windows\tests\9.x.x\Clean-Data.ps1
## View your Docker Container Here: (Defaults below)
http://localhost:44001 (CM)
http://localhost:44002 (CD)
localhost:44010 (SQL)
## Execute Powershell inside a Container - <ID> should match a container ID
docker exec -it <ID> powershell
## Configure the Docker Url in your Docker-Compose yml file
## Under `ports` under each instance
## docker Push/Pull Commands (when working with a registry)
docker-compose pull # Pulls all images referenced in docker-compose locally
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment