added notes and dockerfile for pynode
This commit is contained in:
@ -2,9 +2,12 @@ Stop the Docker daemon:
|
||||
>sudo systemctl stop docker
|
||||
Copy existing Docker data: If you already have images, containers, and volumes that you want to keep, you'll need to move them to the new location. Replace /new/path with the path to the directory where you want Docker to store its data.
|
||||
|
||||
>sudo rsync -aP /var/lib/docker/ /new/path/docker
|
||||
>sudo rsync -aP /var/lib/docker/ /mnt/data/docker
|
||||
>sudo rsync -aP --info=progress2 /var/lib/docker/ /mnt/data/docker
|
||||
|
||||
Edit the Docker configuration file: Open the Docker configuration file with a text editor like nano or vi. The location of this file might vary depending on your Linux distribution, but it's typically found at /etc/docker/daemon.json. If the file doesn't exist, create it.
|
||||
|
||||
rm -rf /mnt/data/docker
|
||||
|
||||
>sudo nano /etc/docker/daemon.json
|
||||
Then add the following content, again replacing /new/path with your desired path:
|
||||
@ -22,4 +25,23 @@ Verify the changes: Run a command like docker info | grep "Docker Root Dir" to e
|
||||
Optional - Clean up old data: If everything is working fine, and you have made a backup, you may want to remove the old Docker directory to free up space:
|
||||
|
||||
|
||||
>sudo rm -rf /var/lib/docker/
|
||||
>sudo rm -rf /var/lib/docker/
|
||||
|
||||
|
||||
rsync -aP /mnt/azure-resource-second-mount/host/mnt/apps/ /mnt/data/apps
|
||||
rsync -aP --info=progress2 /mnt/azure-resource-second-mount/host/mnt/apps/ /mnt/data/apps/
|
||||
rm -rf /mnt/azure-resource-second-mount/host/mnt/apps/
|
||||
|
||||
rsync -aP --info=progress2 /mnt/azure-resource/apps/ /mnt/data/apps/
|
||||
rm -rf /mnt/azure-resource/apps/
|
||||
|
||||
|
||||
rsync -aP --info=progress2 /mnt/data/apps/ /data/apps
|
||||
rm -rf /mnt/azure-resource/apps/
|
||||
|
||||
|
||||
|
||||
rsync -aP --info=progress2 /data/apps /mnt/data/apps
|
||||
rm -rf /mnt/azure-resource/apps/
|
||||
|
||||
|
||||
|
19
linux/docker install.md
Normal file
19
linux/docker install.md
Normal file
@ -0,0 +1,19 @@
|
||||
# install
|
||||
sudo apt-get update
|
||||
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
||||
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
||||
sudo apt-get update
|
||||
sudo apt-get install docker-ce
|
||||
|
||||
# add portainer
|
||||
docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always --pull=always -v /var/run/docker.sock:/var/run/docker.sock -v /mnt/storage/docker_volumes/portainer_data:/data portainer/portainer-ce
|
||||
|
||||
|
||||
# start
|
||||
sudo systemctl start docker
|
||||
sudo systemctl enable docker
|
||||
|
||||
|
||||
# build image
|
||||
sudo docker build -t your-image-name .
|
25
linux/docker nvidia.md
Normal file
25
linux/docker nvidia.md
Normal file
@ -0,0 +1,25 @@
|
||||
3. Setup NVIDIA Container Toolkit:
|
||||
Add the NVIDIA GPG key:
|
||||
|
||||
bash
|
||||
Copy code
|
||||
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
|
||||
Add the NVIDIA Docker repository:
|
||||
|
||||
For distributions based on Ubuntu 18.04 and later:
|
||||
|
||||
bash
|
||||
Copy code
|
||||
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
|
||||
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
|
||||
Install the NVIDIA Docker toolkit:
|
||||
|
||||
bash
|
||||
Copy code
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y nvidia-docker2
|
||||
Restart Docker:
|
||||
|
||||
bash
|
||||
Copy code
|
||||
sudo systemctl restart docker
|
16
linux/linux disks.md
Normal file
16
linux/linux disks.md
Normal file
@ -0,0 +1,16 @@
|
||||
# list all fisks
|
||||
lsblk -f
|
||||
|
||||
# unmount forced
|
||||
# you can try the lazy unmount option, which will immediately remove the filesystem from the file hierarchy and postpone the cleanup:
|
||||
umount --lazy /mnt
|
||||
|
||||
# make partition
|
||||
fdisk /dev/sdX
|
||||
fdisk p # existing partitions
|
||||
# Press n to create a new partition.
|
||||
# press w to write the changes to the disk.
|
||||
sudo mkfs.ext4 /dev/sdXN
|
||||
# mount
|
||||
|
||||
docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always --pull=always -v /var/run/docker.sock:/var/run/docker.sock -v /mnt/apps/docker_volumes/portainer_data:/data portainer/portainer-ce
|
Reference in New Issue
Block a user