-
Notifications
You must be signed in to change notification settings - Fork 8
Home
docker pull areustle/fermibottle
unzip fermibottle.tar.zip && docker load < fermibottle.tar
docker run -it \
-e HOST_USER_ID=`id -u $USER` \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v `pwd`:/data \
-p 8888:8888 \
areustle/fermibottle
This requires XQuartz to be installed and the "Allow Connections from Network Clients" option to be selected in XQuartz > Preferences > Security.
Quit XQuartz after setting this option.
On the command line run:
xhost + 127.0.0.1 && \
docker run -it \
-e HOST_USER_ID=`id -u $USER` \
-e DISPLAY=docker.for.mac.localhost:0 \
-v `pwd`:/data \
-p 8888:8888 \
areustle/fermibottle
Depending on the version of Windows you are running, you will need to install either Docker for Windows (Windows 10 Pro or Enterprise) or Docker Toolkit (everything else). Here are [Instructions for installing Docker on Windows] that covers both options.
Install Xming (https://sourceforge.net/projects/xming/). Be sure to install the XLaunch application and select the "Associate XLaunch with the .xlaunch file extension" option during installation.
Run XLaunch
- No changes on the first screen, click "Next".
- No changes on the second screen, click "Next".
- Select "No Access Control" on screen three. Click "Next".
- If you want to not have to go through this each time, select "Save Configuration" and name your .xlaunch file. You can then just double click this file to start in the future.
- Click "Finish" to start the X11 server.
Start Docker (if it's not already running)
Open a PowerShell or command prompt
On the command line:
- Run
ipconfig /all
and find the IP address for your primary network connection. Note this down somewhere. - Select an existing directory to store your data and note the path (e.g. d:/data/FERMI)
- Run
set-variable -name DISPLAY -value <ip address>:0.0
- Start the docker container by running:
docker run -it \
-e DISPLAY=$DISPLAY \
-v <path to data>:/data \
-p 8888:8888 \
areustle/fermibottle
Note: If the selected directory isn't set up for sharing, Docker will ask if you want to share it. Select 'Share' and then enter your password at the prompt. You need to be an administrator in order to do this.
Exit and shutdown an existing container with exit
in the container's shell
Find the CONTAINER_ID of a container with docker ps -a
Restart a stopped container in the background with docker start CONTAINER_ID
or docker start CONTAINER_NAME
Attach to a running container (get into the shell) with docker attach CONTAINER_ID
or docker attach CONTAINER_NAME
Run a jupyter notebook from within the container with
jupyter notebook --ip 0.0.0.0 --no-browser
cd FermiBottle && docker image build -t fermibottle .
- Save a built image
docker save fermibottle -o fermibottle.tar
- Compress it with zip, to be nice to windows:
zip fermibottle.tar
- Find the hash of your image
docker images
- Tag the image
docker tag IMAGE_HASH areustle/fermibottle:TAGNAME
- Push to dockerhub
docker push areustle/fermibottle
Mostly this container was adapted from the conda-forge linux-anvil container https://github.com/conda-forge/docker-images
I hope the Dockerfile is self-documenting with its comments, but here's a summary.
FermiBottle is built in a Centos 6 container, with the stage name 'builder'. The Yum package manager is used to update the build toolchain. Next scripts are called to install ftools, anaconda, fermitools, tempo(s) etc. This builder container has outlived its usefulness, so a newer, younger container is spun up and the binaries from builder are copied into it. The entrypoint script is copied and set as the docker entrypoint after being passed through tini, the tini-est init process. A volume point is mounted to '/data' and a default command is set to launch a bash shell.
Entrypoint will create the fermi user, set permissions and make symbolic links for the build products. It will pass input prompts through 'gosu' to provide a colorful, functional terminal experience for the fermi user that will properly handle keyboard interrupts and kernal signals.
I'm a Fermi in a bottle, baby. Gotta docker run
me the right way.