/dotnetdocker

Explorations with dotnet and docker

Primary LanguagePowerShellGNU General Public License v3.0GPL-3.0

dotnetdocker

Explorations with dotnet and docker. See the buildAndRunDockerImage.ps1 script

TODO

Explore Docker Compose

Important Docker Commands

Run

dotnet run

Publish

dotnet publish -c Release

Create docker file

New-Item -ItemType File -Path ./newfile.txt

Build the docker image

docker build -t counter-image -f Dockerfile .

View all images

docker images

Build the docker container

docker create --name core-counter counter-image

View all containers

docker ps -a

Filter to a specific container

docker ps -a --filter="name=nginx-base"

Run Container

docker start core-counter

Attach to Container

docker attach --sig-proxy=false core-counter # make sure the ctrl+c will not stop the container

remove image

docker rm core-counter

get docker name formats

docker ps -a --format '{{json .Names}} # use {{json .}} to get all field values

get running docker containers

docker container ls 

to build image and run

docker run -it --rm counter-image # use ctl+c to break out