用于开发的不可变基础设施
1. update the base image
```sh
docker images
docker pull archlinux:base-devel
docker images # list images again
# Remove all dangling images
docker image prune
```
2. build the image
```sh
docker build -f Dockerfile.dev.build -t zane/dev .
```
- create a docker volume if you want it
```sh
docker volume create nvim_red_duck
```
- the env file
- rename
.env.example
to.env
- fill
.env
file with your dir info.
- start docker compose services
cd nvim-nvchad-dockerize
# using .env file
docker-compose run --service-ports dev
# or using another env file
docker-compose --env-file <.env.example> run --service-ports dev
then, the nvim container is creaded and login the shell.
- connect to the container in other terms
# get the id of nvim container
docker ps -a
docker exec -it <the nvim container id> bash
- exit in the first term and docker rm ...
docker start -ai <exited container id>
docker exec -it <running container id> bash
docker run -it -p 3000:3000 -p 4000:4000 -p 8000:8000 -p 9000:9000 -v c:\a:/home/nv/a -v c:\Users\username\.ssh:/home/nv/.ssh -v "//var/run/docker.sock:/var/run/docker.sock" zane/dev
sudo chmod 600 /home/nv/.ssh/config
docker start -ai <exited container id>
docker exec -it <running container id> bash
# as root
docker exec -u 0 -it <running container id> bash
# in docker # as root
reflector -f 5 --country 'United States' --protocol https --sort rate --download-timeout 2 --save /etc/pacman.d/mirrorlist
reflector -f 5 --country 'United States' \
--protocol https \
--sort rate \
--download-timeout 2 \
--completion-percent 100 \
--save /etc/pacman.d/mirrorlist
docker volume create --name new_volume
docker container run --rm -it \
-v old_volume:/from \
-v new_volume:/to \
alpine ash -c "cd /from ; cp -av . /to"
git init .
# change to the main branch
git config --global init.defaultBranch <main>
git branch -m <main>
# project settings, not globle
git config user.name <"monster">
git config user.email <"i@monster">
git remote -v
# edit the git settings file
git config --global --edit
GIT_SSH_COMMAND="ssh -i ~/.ssh/a_private_key" git push origin main
- shoutdown WSL
wsl --shutdown
- then, docker-desk ask you restart the WSL2, or right click docker-desk icon and click restart.
- close docker desktop
- shoutdown WSL2
-
Maybe reinsall replace update it from old version of neovim-qt
-
Maybe remove nvchad first before reinstall neovim-qt
# windows
rd -r ~\AppData\Local\nvim
rd -r ~\AppData\Local\nvim-data
choco install neovim
docker start -ai 590d
Error response from daemon: Ports are not available: exposing port TCP 127.0.0.1:4000 -> 0.0.0.0:0: listen tcp 127.0.0.1:4000: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
Run comands as administrator
net stop winnat
net start winnat