DevOps

Dockerfile


Spring Datafication 2022. 5. 24. 09:27
This is a continuation from docker processes and docker volumes

Build own images
This allows us to build our own images.



The most common commands used in Dockerfiles is shown in the image below


All single command to build a Dockerfile can be found on this page Docker file reference
We month volume into the container.We are able to view the website before. When we build custom image we dont need to mount volumes.But we need to copy files into the image. What we want to do is run custom image and run container from it.

Docker Image

  • Image is a template for creating an environment of your choice
  • Snapshot
  • Has everything need to run your apps
  • OS, software, app code

FROM

The name of the base image that we want to use

in our case we want to use the nginx:latest base image

ADD

We want to copy content from the directory into the destination of our container

Now we have a dockerfile we now need to produce an image from this docker file

Building a Docker Image

The way an image is built by running this command.
we must specify the docker image name ,tags, and the location of the docker file

docker build --tag fassitecusimage:latest .

we have successfully built our docker image from the docker file.

we can check our newly created image from the docker image list

docker image ls



We can build a container with this image

반응형

'DevOps' 카테고리의 다른 글

How to Enable root User Login in EC2  (0) 2023.03.02
onlyoffice for alfresco 7.2.X | 7.3.X  (0) 2023.01.09
What is API Gateway Throttling  (0) 2022.09.28
Docker Process & Volumes  (0) 2022.05.23
Docker  (0) 2022.05.23