파일구조
./docker_ubuntu
./docker_ubuntu/data (빈폴더 : 로컬과 컨테이너 폴더 동기화)
./docker_ubuntu/ubuntu1804 (로컬과 컨테이너 폴더 동기화)
./docker_ubuntu/ubuntu1804/Dockerfile
./docker_ubuntu/ubuntu2004 (로컬과 컨테이너 폴더 동기화)
./docker_ubuntu/ubuntu2004/Dockerfile
./docker_ubuntu/docker-compose.yml
./docker_ubuntu/docker-compose.yml
version: '2'
services:
ubuntu1804:
hostname: ubuntu1804
container_name: ubuntu1804
build:
context: .
dockerfile: ./ubuntu1804/Dockerfile
stdin_open: true
tty: true
volumes:
- ./ubuntu1804:/ubuntu1804
- ./data:/data
ubuntu2004:
hostname: ubuntu2004
container_name: ubuntu2004
build:
context: .
dockerfile: ./ubuntu2004/Dockerfile
stdin_open: true
tty: true
volumes:
- ./ubuntu2004:/ubuntu2004
- ./data:/data
./docker_ubuntu/ubuntu1804/Dockerfile
FROM ubuntu:18.04
RUN apt update -y
RUN apt install python3.6 -y
RUN apt install vim -y
RUN apt install net-tools -y
RUN apt install iputils-ping -y
RUN apt install python3-pip -y
WORKDIR /root
RUN echo 'alias python=python3.6' >> .bashrc
WORKDIR /
./docker_ubuntu/ubuntu2004/Dockerfile
FROM ubuntu:20.04
RUN apt update -y
RUN apt install python3.8 -y
RUN apt install vim -y
RUN apt install net-tools -y
RUN apt install iputils-ping -y
RUN apt install python3-pip -y
WORKDIR /root
RUN echo 'alias python=python3.8' >> .bashrc
WORKDIR /