Posts

Showing posts from August, 2021

Understanding of Dockerfile and its commands?

Image
We have used Docker images to create containers and we pull the images from Docker Hub to create containers. But in this article,  we will see how docker images are creating and what commands are using as part of this process. Docker can build images automatically by reading the instructions from a Dockerfile . A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image. Think of it as a shellscript. It gathered multiple commands into a single document to fulfill a single task. build command is used to create an image from the Dockerfile.   $ docker build   You can name your image as well.   $ docker build -t my-image  If your Dockerfile is placed in another path,   $ docker build -f /path/to/a/Dockerfile  Let's first look at below Dockerfile and see those commands. FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build WORKDIR /src COPY MyMicroservice.csproj . RUN dotnet restore COPY . . RUN dotnet...

The storage location of Docker images and containers?

  A Docker container consists of network settings, volumes, and images. The location of Docker files depends on your operating system. Here is an overview for the most used operating systems: Ubuntu:  /var/lib/docker/ Fedora:  /var/lib/docker/ Debian:  /var/lib/docker/ Windows:  C:\ProgramData\DockerDesktop MacOS:  ~/Library/Containers/com.docker.docker/Data/vms/0/ In macOS and Windows, Docker runs Linux containers in a virtual environment. Therefore, there are some additional things to know. Docker for Mac Docker is not natively compatible with macOS, so  Hyperkit  is used to run a virtual image. Its virtual image data is located in:   ~/Library/Containers/com.docker.docker/Data/vms/0 Within the virtual image, the path is the default Docker path  /var/lib/docker . You can investigate your Docker root directory by creating a shell in the virtual environment: $ screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty You can kill this...

How To Set Up an IIS Web Site on Windows Server Docker Containers?

Image
  When you think of containers, it's easy to think of Linux first. Most containers and container workflows are built on Linux, and for obvious reasons. Linux starts faster, takes up less space on disk and doesn't have any licensing costs. However, while Linux containers are the most popular, they are not the only kind of containers out there. Wouldn't it be cool to run Internet Information Services (IIS) in a container, as well? Windows containers Windows containers come in a few different varieties, the most popular being Nano Server and Server Core. Nano Server is the smallest version of Windows available, clocking in at just 256MB. This is a stripped-down version of Windows that has only the essentials necessary to run the operating system. Server Core is significantly larger at about 5GB, but has more tools and capabilities, including the IIS Web server feature. Windows containers run through  Docker for Windows , and are well-suited for migrating legacy systems and Web...

docker push failed and showing-'denied: requested access to the resource is deniedd’

Image
First , login your docker account. using  docker login Second, use this command: docker images this command can show you all images you have, then you chose an image to push. like as below   Third, you should add a tag for image you chose. You can use this command: docker tag existent_image_name:latest your_user_name/new_image_name:latest ex: Finally, you use this command: docker push your_user_name/new_image:latest good luck.