Code Monkey home page Code Monkey logo

cosantoolsdocker's Introduction

CosanLab Docker Analysis Container

Full Python based analysis environment including tools for Neuroimaging Analysis used in the CosanLab
Eshin Jolly ([email protected])

Currently contains (and subject to change):

Downloading the container

Make sure you have docker installed on your computer. Then you can use the following command:

docker pull ejolly/cosantoolsdocker

This will pull a copy of the docker image to your local machine.
Warning: This download might take a bit because the image size is quite large (~4.3Gb) because of the tools it contains.

Basic Use

There are (at least) two ways you might use this container:

1. Use it to serve a jupyter notebook instance for data analysis only

The following command starts a container with a Jupyter Notebook server listening on port 8888:

docker run -d -p 8888:8888 ejolly/cosantoolsdocker jupyter notebook --port=8888 --no-browser --ip=0.0.0.0

This will create a new container running a jupyter notebook server which will look just like launching a jupyter notebook server on your local machine.

You can navigate to localhost:8888 on your machine's internet browser to access this notebook just as you would normally. Keep in mind that it actually lives and is being served from within the container!

To close the notebook and the container at any time simply issue a quit command in the terminal window where the jupyter notebook is being serve (ctrl/cmd + D).

2. Create an interactive container with a full ubuntu environment

The following command will create a new container and open up a bash terminal inside the container:

docker run -it -p 8888:8888 --name yourContainerName -v /path/to/folder/on/your/comp/to/share:/path/to/mount/folder/in/container ejolly/cosantoolsdocker

Port Issues:
If you already have a jupyter notebook running locally on your computer at port 8888 you will probably need to close it before creating a container, then reopen it after. This is because this container only exposes port 8888, whereas jupyter notebooks will find a free port serve from if 8888 is in use.

If you still have port problems, trying restarting Docker itself (click on the whale icon by your system clock and select restart).

This container is persistent so when you close it (i.e. ctr/cmd+D) it will shutdown but will not be deleted.
You can add the --rm flag to the command above to auto delete on exit.

To reconnect to the same container you just created use the following commands:

docker start yourContainerName
docker attach yourContainerName

If instead you want to create a separate new container, just use the docker run command above and supply a new container name.

Serving a juptyer notebook from within this interactive container

Within the bash shell simply use the following command to start serving a jupyter notebook:

jupyter notebook --port=8888 --no-browser --ip=0.0.0.0

Because this shell is now in use serving the notebook, you might be interesting in opening up another shell within the same container. You can use the following command to do so:

docker exec -it yourContainerName /bin/bash

Other helpful commands

  • See what docker images you have downloaded and can be used to create new containers:
    • docker images
  • See running container dockers:
    • docker ps
  • See all docker container you have created (including those not running):
    • docker ps -a
  • Startup and connect to previously created container:
    • docker start yourContainerName
    • docker attach yourContainerName
  • Delete a docker container:
    • docker rm yourContainerName
  • Delete a docker image:
    • docker rmi yourImageName
  • Stop a running container:
    • docker stop yourContainerName
  • Execute a new command in an existing docker container
    • docker exec yourContainer command
  • Delete all containers that are no longer running:
    • docker rm $(docker ps -aq -f status=exited)
  • Force delete ALL containers
    • docker rm -f $(docker ps -aq)

cosantoolsdocker's People

Contributors

ejolly avatar

Watchers

James Cloos avatar Ben J. Smith avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.