Docker

How to install packages using apt inside docker container?

You need to run apt update at first. Meanwhile, you need the root permission to run apt.

What is the command to mount local filesystem to docker container on Windows?

# In cmd console
docker run -v %cd%:/home image

# In powershell
docker run -v ${pwd}:/home image

How do I edit files inside container?

You can use the editor(s) provided in the container, usually it would be nano or vim, which depends on what had been wrapped by the image author.

Nano cheatsheet

You can also editor files on your host machine with your favorite editor and mount them or copy them to the container.

Docker is too large to install in C drive on Windows!

See move docker to another drive

I have "permission denied" working inside Docker on Mac

First, mac users do not need to specify uid, so please just run as a super user inside docker, i.e., without specifying -u id -u:id -g`` in the docker run command.

If it can not help, maybe there is some subtlety in the Mac general settings. Visit "System preferences > Security & Privacy > Files and Folders", and grant Docker the permission on various folders. Please see more on this link.

Docker pulling is too slow!

See https://yeasy.gitbook.io/docker_practice/install/mirror

FAQ for Docker Descktop

Madgraph

Permission denied when import UFO model in madgraph container (for Linux users)?