✌️
Studylog
See More
Studylog
Studylog
  • INTRO
  • AWS
    • AWS101
      • Virtualization and the AWS structures
      • AWS account and free-tier
      • AWS IAM
      • AWS EC2
        • EC2 basic
        • ENI and EIP
        • Elastic Block Storage
        • Auto Scaling
        • Elastic Load Balancer
  • IaC
    • Terraform
      • License Change
      • Tutorial
      • Module
      • Versioning
  • Airflow
    • Airflow-Ninja
      • Introduction and Goal
      • Tutorial: Settings
      • Tutorial: Module Import, Alert
  • Docker
    • Production with Docker
      • Customizing root directory
  • Network
    • Network-Handbook
      • Introduction and Goal
      • OSI7Layer
      • DNS
      • SSL/TLS
  • Comupter Architecture
    • Basic
      • Introduction and Goal
      • Chapter 1. The Internal Language of Computers
      • Chapter 2. Combinatorial Logic
      • Chapter 3. The Essentials of Memory and Disk Sequential Logic
    • Hands-on
      • Introduction and Goal
      • theory
        • Chapter 1. Logic Gates
        • Chapter 2. ALU
      • project
        • Project 1. Elementary logic gates implement
        • Project 2. Boolean Arithmetic
  • Java
    • Readable Code
      • ν•™μŠ΅ λͺ©μ 
      • 좔상화
      • 논리적 사고 흐름
      • 객체지ν–₯ 이둠
      • 객체지ν–₯ μ½”λ“œ μ μš©ν•˜κΈ°
      • μ½”λ“œ 닀듬기
      • 읽기 쒋은 μ½”λ“œλ₯Ό 도와쀄 μ‘°μ–Έλ“€
  • Spring Boot
    • Practical Testing
      • ν…ŒμŠ€νŠΈ 사전 지식
      • μŠ€ν”„λ§ λ ˆμ΄μ–΄λ“œ μ•„ν‚€ν…μ²˜ ν…ŒμŠ€νŠΈν•˜κΈ°
        • Persistence Layer
        • Business Layer
    • μŠ€ν”„λ§ 핡심 원리 - 기본편
      • 객체 μ§€ν–₯ 섀계와 μŠ€ν”„λ§
      • μŠ€ν”„λ§ 핡심 원리 이해
        • 예제 λ§Œλ“€κΈ°
        • 객체 μ§€ν–₯ 원리 적용
        • μŠ€ν”„λ§ μ»¨ν…Œμ΄λ„ˆμ™€ μŠ€ν”„λ§ 빈
  • Python
    • Effective Python
      • Introduction and Goal
      • Closure: Lazy Evaluation And Eager Evaluation
      • Python public attributes are better getter-setter
      • No refactoring attribute, we can use property decorator
      • You can do it, but it means you don't have to
  • Playgrounds
    • Java Playground
      • ν•™μŠ΅ λͺ©μ 
      • 숫자 야ꡬ κ²Œμž„
        • ν•™μŠ΅ ν…ŒμŠ€νŠΈ
        • λ¬Έμžμ—΄ 계산기
        • 숫자 야ꡬ κ²Œμž„ κ΅¬ν˜„
        • 숫자 야ꡬ κ²Œμž„ λ‹€μ‹œ κ΅¬ν˜„ν•˜κΈ°
      • μžλ™μ°¨ κ²½μ£Ό
        • λ¬Έμžμ—΄ λ§μ…ˆ 계산기
        • μžλ™μ°¨ κ²½μ£Ό λ―Έμ…˜ κ΅¬ν˜„
      • μ’Œν‘œ 계산기
        • μ—°λ£Œ μ£Όμž…
        • μ’Œν‘œ 계산기 λ―Έμ…˜ κ΅¬ν˜„
    • Infra Playground
      • VPC: 망뢄리 그리고 ν…ŒμŠ€νŠΈ
      • μ»¨ν…Œμ΄λ„ˆ 사전 지식
      • ν™”λ©΄ μ„±λŠ₯ κ°œμ„  μ „ ν•™μŠ΅ ν…ŒμŠ€νŠΈ
      • SSM: Session Manager
      • SQL, 이 μ •λ„λŠ” μ•Œμ•„μ•Όμ§€ 😎
      • Subway-Map
        • 망 κ΅¬μ„±ν•˜κΈ°
        • μ„œλ²„ κ΅¬μ„±ν•˜κΈ°
        • ν™”λ©΄ μ„±λŠ₯ κ°œμ„ ν•˜κΈ°
      • Conference Platform
        • 망 κ΅¬μ„±ν•˜κΈ°
        • μ„œλ²„ κ΅¬μ„±ν•˜κΈ°
        • ν™”λ©΄ μ„±λŠ₯ κ°œμ„ ν•˜κΈ°
  • Tools
    • SOPS
    • Bruno
    • πŸ–₯️FCK-NAT
    • 🧊Pulumi
Powered by GitBook
On this page
  • How to change the root directory in Docker?
  • System ν™˜κ²½
  • Docker service stop
  • Check the Docker root directory
  • Create the new directory
  • Customizing docker option
  • Restart
  1. Docker
  2. Production with Docker

Customizing root directory

PreviousProduction with DockerNextNetwork-Handbook

Last updated 10 months ago

Properties

2024.08.06

How to change the root directory in Docker?

μ™œ 도컀 μ €μž₯ 경둜λ₯Ό λ³€κ²½ ν•˜λ €κ³  ν•˜λŠ”κ°€?

사내 개발 μ„œλ²„λŠ” 루트 디렉터리 λ””μŠ€ν¬ μŠ€νŽ˜μ΄μŠ€κ°€ 8κΈ°κ°€λ‘œ μ œν•œ λ˜μ–΄μžˆλ‹€. ν•˜μ§€λ§Œ, data μ˜μ—­μ—λŠ” 300κΈ°κ°€λ‘œ ν• λ‹Ή λ˜μ–΄μžˆκΈ° λ•Œλ¬Έμ— 도컀 νŒŒμΌμ„ κ΄€λ¦¬ν•˜λŠ” μ €μž₯μ†Œλ₯Ό data μ˜μ—­μœΌλ‘œ μ„€μ • ν•˜λŠ” μž‘μ—…μ΄ ν•„μš”ν–ˆλ‹€.

System ν™˜κ²½

  • Amazon Linux

  • Docker version: 25.0.6

  • example directory name: /data/docker

Docker service stop

  1. μ†ŒμΌ“ μ’…λ£Œ

sudo systemctl stop docker.socket
  1. μ„œλΉ„μŠ€ μ’…λ£Œ

sudo systemctl stop docker.service

Check the Docker root directory

docker info | grep "Docker Root Dir"

example:

ν•œ λ²ˆλ„ 도컀 섀정을 κ±΄λ“œλ¦° 적 μ—†λ‹€λ©΄ κΈ°λ³Έ κ²½λ‘œλŠ” μ•„λž˜μ™€ κ°™λ‹€.

Docker Root Dir: /var/lib/docker

Create the new directory

  • λ§Œμ•½ 보쑴해야 ν•  이미지가 μžˆλ‹€λ©΄?

    sudo rsync -aP /var/lib/docker /data/docker
  • μƒˆλ‘­κ²Œ 도컀 디렉터리λ₯Ό κ΅¬μ„±ν•œλ‹€λ©΄?

    mkdir /data/docker

permission 슀슀둜 잘 ν•΄κ²° ν•˜μž(λ³ΈμΈμ—κ²Œ ν•˜λŠ” μ†Œλ¦¬)

Customizing docker option

{
    "data-root": "/data/docker"
}

Restart

sudo systemctl start docker
πŸ“