Posted on

Some Docker basic Commands

docker search microsoft

dotnet new HelloWorld

create dockerfile
From microsoft/dotnet:1.0.0-rc2-core

WORKDIR /app COPY /app /app

ENTRYPOINT dotnet HelloWorld.dlldotnet

dotnet restore

dotnet build -c release

dotnet publish -c release -o app

docker build -t helloworld .
docker images

docker ps

docker run helloworld

void static main()

{

for (int i = 0 ; i < 30 ; i++)

{System.Threading.Thread.Sleep(1000);

Console.Writeline(“Hello”);

}

}
docker build -t helloworld:loop

docker run -d helloworld:loop

docker run -d helloworld:loop

docker run -d helloworld:loop

docker run -d helloworld:loop

docker task is gone sooner or later.
docker ps
docker tag helloworld:loop frank/helloworld:dotnetconf

docker push frank/helloworld:dotnetconf
Docker ToolBox : Shared Folders: c/Users c:\Users Yes Full

docker logindocker run -v h:c

docker-machine ls

docker-machine env dockerhost-linux

docker-machine activedocker-machine ip dockerhost-linux

%Userprofile%\.docker\machine\

Docker Compose:
version: ‘2’services:
multiservices:

image: frank/multiservice:latest
#set environment variables
environment:

– CustomerAPIService = http://webapi/api/Customer
#Make Port available

ports:

– “80:80”

#Set the container startup order

depends_on:

-webapi

# the .Net Core WebAPI

Servicewebapi:

image: frank/mulitiserviceapi:latest

 

docker-compose up -d

 

One thought on “Some Docker basic Commands

Leave a Reply

Your email address will not be published. Required fields are marked *