본문 바로가기
카테고리 없음

docker 튜토리얼

by icebear3000 2023. 3. 11.
반응형

First, clone a repository
The Getting Started project is a simple GitHub repository which contains everything you need to build an image and run it as a container.

Clone the repository by running Git in a container.


docker run --name repo alpine/git clone https:/
/github.com/docker/getting-started.git
Unable to find image 'alpine/git:latest' locally
docker cp repo:/git/getting-started/ .

 

You can also type the command directly in a command line interface.

 

Now, build the image
A Docker image is a private file system just for your container. It provides all the files and code your container needs.
icebearui-MacBookAir:~ icebear$ docker cp repo:/git/getting-started/ .
icebearui-MacBookAir:~ icebear$ cd getting-started
icebearui-MacBookAir:getting-started icebear$ docker build -t docker101tutorial .

 

Run your first container
Start a container based on the image you built in the previous step. Running a container launches your application with private resources, securely isolated from the rest of your machine.

 

icebearui-MacBookAir:getting-started icebear$ docker run -d -p 80:80 --name doc
ker-tutorial docker101tutorial

 

Now save and share your image
You must be signed in to Docker Hub to share your image. Sign in here.
Save and share your image on Docker Hub to enable other users to easily download and run the image on any destination machine.

 

 

 

 

 

 

 

반응형

댓글