Docker Commands

  1. To get the ip address of the container
    docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" [Container Name]
  2. To build application for docker file within the code path
    docker build -t [Application image name] .
  3. Run an image into container by assigning port and container name
    docker run -d -p 80:80 --name [container name] [image name]
  4. To stop running container
    docker stop [container Name]
  5. To remove container from host
    docker rm [container name]
  6. To remove image
    docker rmi [container Name]
  7. To Install Docker on windows server 2016, Run below commands in powershell to install docker on windows server
    Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
    Install-Package -Name docker -ProviderName DockerMsftProvider -Force
    Restart-Computer –Force
  8. To check the docker version running in the system
    docker version
  9. To check whether docker is running in the system
    Get-Service docker
  10. To start docker in the system
    Start-Service docker
  11. To install chocolatey
    iwr -UseBasicParsing | iex


**I will add more commands here as I explore.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s