사용자 도구

사이트 도구


wiki:3party:docker:리눅스_설치

Linux 설치

docker-compose.yml

version: '3.8'
 
services:
    centos8:
        hostname: centos8
        container_name: centos8
        privileged: true
        user: root
        build:
            context: .
            dockerfile: Dockerfile
        stdin_open: true
        tty: true
        volumes:
            - ./data:/data
        ports:
            - '2228:22'
            - '2280:80'
            - '2281:7000'
            - '2282:7001'
            - '2283:7002'
            - '2284:7003'
            - '2285:7004'
        expose:
            - '2228'
            - '2280'
            - '2281'
            - '2282'
            - '2283'
            - '2284'
            - '2285'
        command: /sbin/init

Dockerfile

FROM centos:8 
WORKDIR /  
$> docker-compose up -d
$> yum install -y openssh-server
$> vi /etc/ssh/sshd_config <- 포트 변경
 
$> yum install -y passwd
$> /usr/sbin/useradd www   <- 사용자 생성
$> yum install -y net-tools
$> yum install -y make gcc gcc-c++ libstdc++-devel 
$> yum install -y unzip file cronie mlocate binutils
/volume1/web/dokuwiki/data/pages/wiki/3party/docker/리눅스_설치.txt · 마지막으로 수정됨: 2023/01/13 18:44 (바깥 편집)