Change Docker root directory /var/lib/docker to another location
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- docker, linux
- Lĩnh vực
- devops, infrastructure
Hướng nghiên cứu
Review the repository's existing organization for programming tips, then verify the Docker commands and storage-driver references in the issue against the linked Docker documentation. Done means the relocation instructions are added in the project's established format and clearly cover stopping, moving, reconfiguring, restarting, and filesystem limitations.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
By default, Docker stores most of its data inside the /var/lib/docker directory on Linux systems. There may come a time when you want to move this storage space to a new location. For example, the most obvious reason might be that you’re running out of disk space.
1.How to edit systemd to accommodate new Docker location? stop the service, update config, and restart
$sudo systemctl stop docker.service
$sudo systemctl stop docker.socket
$sudo vim /lib/systemd/system/docker.service
The line we need to edit looks like this:
ExecStart=/usr/bin/dockerd -H fd://
Edit the line by putting a -g and the new desired location of your Docker directory. When you’re done making this change, you can save and exit the file.
# for old docker
ExecStart=/usr/bin/dockerd -g /mnt/data/docker/ -H fd://
# for newer versions
ExecStart=/usr/bin/dockerd --data-root /mnt/data/docker/ -H fd://
2.How to move your Docker installation to a new location?
sudo mkdir -p /data/docker
sudo rsync -aqxP /var/lib/docker/ /data/docker
start docker:
$ sudo systemctl daemon-reload
$ sudo systemctl start docker
Note, if you get error of:
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xeu docker.service" for details.
It may caused by File System not supported by docker. For my case, when I try to save docker data to NAS driver, it failed. For local driver, it works.
The docker data should be stored on a supported backing filesystem as mentioned here:
https://docs.docker.com/engine/storage/drivers/select-storage-driver/#supported-backing-filesystems
- Ngôn ngữ chính
- Python
- Star
- 5
- Fork
- 2
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của davideuler/programming-tips
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
-
list tags for docker imageĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 35/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
-
build milvus on MacĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Tất cả issue của davideuler/programming-tips
Issue tương tự
-
bug server
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
sportsdataverse/sportsdataverse-py#641 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
googleapis/google-cloud-python#18532 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày