README.md 1.19 KB
Newer Older
1
# docker-science-stack
2
Docker cheatsheet:
Nick Bearson's avatar
Nick Bearson committed
3
```bash
4
# Run the image, get a shell
5
docker run -t -i nbearson/docker-science-stack /bin/bash
6
# Run the image, get a shell, and mount the current directory as /workspace
7
docker run -it --rm -v "$PWD":/workspace -w /workspace nbearson/docker-science-stack /bin/bash
8
9

# Build the image from just the Dockerfile
10
docker build -t nbearson/docker-science-stack .
11
# Push the built image to Dockerhub
12
docker push nbearson/docker-science-stack
Nick Bearson's avatar
Nick Bearson committed
13
```
14
15
16
17
18
19
20
21

# Why?

* I want to try out an a new version of GCC without having to worry about properly isolating it from the rest of my machine and deleting it later.
* I'm on a mac and want to compile code for a linux machine without dedicating idle resources to a VM.
* Once someone has done the work of putting together a docker image with everything you need (and we rarely need something too special), you can get a copy and use it with 1 terminal command.
* *Why not?*

Nick Bearson's avatar
Nick Bearson committed
22
For gcc only without the frills:
23

Nick Bearson's avatar
Nick Bearson committed
24
25
https://hub.docker.com/_/gcc/  
https://github.com/docker-library/gcc  
26
27

This is a debian-based image, but it comes with gcc (and now gfortran!) preinstalled and nothing else. Nice for getting a compiler for free to put through the paces.