Prepare a server with root permissions
Create a subuser for development
- Use the adduser command to create a new user:
sudo adduser newuser
- To add sudo permissions to the new user, edit the sudoers file:
sudo visudo
- Add to the file:
newuser ALL=(ALL:ALL) ALL
- Add new user to docker user group:
sudo usermod -aG docker newuser
- Change permissions
chmod 666 /var/run/docker.sock
Deploy a personal inference development environment
- Dockerfile (build your own image)
It is best that the image has hardware dependencies installed
FROM your-image:test
ENTRYPOINT []
CMD ["sleep","100000000000"]
- docker-compose.yml
version: '3'
services:
infer:
image: lijiacai_infer:latest
volumes:
- /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime
- /usr/sbin/efsmi:/usr/sbin/efsmi
- ./:/workspace/
network_mode: host
shm_size: '8gb'
privileged: true
- start up
docker-compose up -d
Use vscode for remote connection development
It is recommended that each user who belongs to the system sub-user configure their own git key on the host machine.
Install plugin
- Remote SSH
- dev Container
Select a server and connect
Connect to a container and enter the development container