And Brain said,
[Docker] Running CentOS 7 in a Docker container 본문
반응형
If you want to set up a Linux build environment on Windows, a Linux container can be a good solution.
Here's the sample dockerfile for CentOS 7, also added git for you.
If you've created the dockerfile, turn on Windows powerShell and go to the directory where the dockerfile is located.
And then, create a network, build an image, and create & run a container from that image.
// network bridge
docker network create --driver bridge dev-network
// image build
docker build -f dockerfile.dev --build-arg arch=amd64 -t cent7:dev .
// create & run container
docker run -d -p18000:8000 -v ${pwd}/source:/root/customFile --net dev-network --name cent7dev cent7:dev
Almost there.
Now, you just connect to the container.
docker exec -it cent7dev bash
It's over.
Thanks for watching, Have a nice day.
반응형
'IT > Docker' 카테고리의 다른 글
[Docker] Docker야, 이리오거라! (0) | 2022.09.26 |
---|---|
[Docker] Node js를 위한 Docker container 만들기 (5) | 2022.09.20 |
Comments