Skip to content

Latest commit

 

History

History
30 lines (29 loc) · 1.46 KB

DockerCommands.md

File metadata and controls

30 lines (29 loc) · 1.46 KB

Prerequisites

  • An Ubuntu Linux box
  • The sonic docker image in your home directory.
    • Pre-built sonic-mgmt can also be downloaded from here
  • Basic knowledge of docker commands.
  • Docker-tools should be there installed in your system.

sonic-mgmt docker environment preparation: useful commands (for Ubuntu system)

Installing docker
sudo apt-get update
sudo apt-get remove docker docker-engine docker.io
sudo apt install docker.io
sudo systemctl start docker
sudo systemctl enable docker

Unzip sonic Image
gzip -d docker-sonic-mgmt.gz

Load the docker Image
sudo docker images
sudo docker load -i docker-sonic-mgmt
sudo docker run -it --name sonic docker-sonic-mgmt

Stopping a docer session
sudo docker stop sonic

Reconnect to a stopped docer session
sudo docker start -i sonic

When you are done you may remove the image sonic
sudo docker rm sonic

Remove docker by image Id
sudo docker rmi -f <image-id>

Running a sonic docker with local directoy mounted in it.
sudo docker run -it --name sonic --privileged -v /home/ubuntu/adhar/:/var/johnar/adhar --workdir /var/johnar/adhar --user johnar:gjohnar docker-sonic-mgmt