Skip to content

Commands

Adrian Wilke edited this page Nov 16, 2018 · 13 revisions

Commands

Edit config

sudo docker cp nbgjava:/opt/conda/etc/jupyter/nbgrader_config.py ./
sudo chown <USER> nbgrader_config.py 
nano nbgrader_config.py 
sudo docker cp ./nbgrader_config.py nbgjava:/opt/conda/etc/jupyter/nbgrader_config.py
sudo docker restart nbgjava

Docker

List docker elements

docker container ls -a
docker image ls -a
docker volume ls

Stop all containers

docker kill $(docker ps -q)

Remove / delete all docker elements (be careful!)

docker rm $(docker ps -a -q)
docker rmi -f $(docker images -a -q)
docker system prune -a

Source: https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes

Change host port of docker container

  • Get container names: sudo docker container ls -a
  • Get ID of container: sudo docker inspect <CONTAINERNAME> | grep Id
  • Stop container: sudo docker stop <CONTAINERNAME>
  • Stop docker: systemctl stop docker
  • Change port: sudo nano /var/lib/docker/containers/<CONTAINERID>/hostconfig.json
  • Start docker: systemctl start docker

Sources:

Remove default nbgrader container & mount point

sudo docker stop nbgjava ; sudo docker rm nbgjava ; sudo rm -rf /mnt/nbgjava/

nbgrader import example

nbgrader db student import --db=sqlite:////home/nbgadmin/gradebook.db /full/path/to/file.csv

id,last_name,first_name
student2,Smith,Claudius
student1,Student1Last,Student1First

nbgrader export example

nbgrader export --db="sqlite:////tmp/gradebook.db" --to pggrades.csv
Clone this wiki locally