-
Notifications
You must be signed in to change notification settings - Fork 0
Docker faq
First of all, read the Docker text about containers.
Possible issues:
- You may need to do sudo docker - if so, add yourself to the docker group according to the instructions in Q2.
- The Docker server is not yet started - look in the system tray to find the Docker icon.
Adding your username to the docker group will allow you to run docker commands with your user account instead of as root. This means you won't have to type sudo in front of each docker command you use (and as a result, you don't have to type in your account password for every command). Additionally, it will avoid issues with Spark and Zeppelin web interfaces later.
Add the group if it does not yet exist:
sudo groupadd docker
Add yourself to the group (the -a is important or you may lock yourself out of administration rights):
sudo usermod -aG docker ${USER}
su -s ${USER}
If the su -s fails, just quit your terminal and start another one, and if that still does not help, logout and login again.
Now test for success:
docker run hello-world
Q3: I receive the error message connect to host 434c982d9cb4 port 22: Connection refused, what should I do?
Because we use a rather small docker image, the SSH deamon does not restart when restarting the docker. This has to be done manually, which you can do by issuing:
sudo /opt/ssh/sbin/sshd
You can exchange files between the host and the container in many different ways:
-
Use docker cp to copy files between a container and the local filesystem e.g.:
docker cp tmp.txt hello-hadoop:tmp.txtwhich moves the filetmp.txtfrom your file system into the container. By swapping the parameters,docker cp hello-hadoop:tmp.txt tmp.txtyou can move a file from the container to your file system. -
Use
scpto copy files via lilo (the FNWI LInux LOgin server); your homedir in the terminal room is also mounted through NFS on lilo. -
Third option, not possible in the Huygens terminal rooms: Create a directory
${HOME}/bigdatain your homedir that you share with the Docker container using the-vflag to the docker run command. -
Use a git repo checked out on host and inside container. Note that the course container does not install git so you'd have to add it.
At the risk of oversimplifying, the files/directories visible in the Linux environment are located in a folder somewhere in your Windows file system (actually, a virtual drive but that's more technical detail than necessary), and Linux can't see anything "outside" of that folder. To find said folder, run explorer.exe . in Linux, which will open an explorer window in the location of your Linux files. for a somewhat longer explanation, click this link. To get files to and from Linux, simply copy them from their source to the Linux location (or vice versa). You can edit files directly in the Linux folder as well.
- Install podman
- In some distributions, add the package
podman-dockerfor convenience - then you do not even have to typepodmaninstead ofdockerand everything works exactly as in the assignment instructions - You may encounter an error when pulling rubigdata repositories:
Error: short-name "rubigdata/<repo>" did not resolve..., to resolve this try prepending the short-name with docker.io, i.e.podman pull docker.io/rubigdata/redbad - Check if you need to do the same (moving containers to another location) as on the Huygens machines, by reading the Huygens FAQ
Please add a Q&A pair when you have seen a question and know the answer!
Cannot find the answer you need? Find help in the Matrix Lab Sessions room.