Friday, October 29, 2021

Installing Docker on Windows

Install-Module -Name DockerMsftProvider -Repository PSGallery -Force

Install-Package -Name docker -ProviderName DockerMsftProvider -Force -RequiredVersion 19.03

Start-Service docker

docker image pull mcr.microsoft.com/windows/nanoserver:1809

docker container run -d -p 8080:80 sixeyed/whoami-dotnet:3.0

iwr -useb http://localhost:8080


Dowloading your image from Azure ACR


docker login acr.azurecr.io -u acr

docker image ls acr.azurecr.io

docker pull acr.azurecr.io/p056aapi:latest

  

Monday, October 4, 2021

Pushing new docker images to Azure ACR

1. Create a hello world program (Optional).

curl http://timelessname.com/elfbin/helloworld.tar.gz --output helloworld.tar.gz

mkdir helloworld

tar -xvf helloworld.tar.gz -C ./helloworld

cd helloworld/

./hello


2. Create a docker file

FROM scratch
COPY hello /
CMD ["/hello"]

3. Build docker:

docker build --tag hello .

4. Verify it can start:

docker run --rm hello

5. Login to ACR:

az login
az acr login --name <yourrepo>.azurecr.io

6. Rename your docker and push:

docker tag hello <yourrepo>.azurecr.io/samples/helloworld:v1
docker push <yourrepo>.azurecr.io/samples/helloworld:v1


6. Login interactively to container


a running container: docker exec -it <container-name-or-id> bash
run a container: docker run --entrypoint /bin/bash -it <image>