https://github.com/kaczmarj/container-examples
Examples of Dockerfiles and Singularity recipes
https://github.com/kaczmarj/container-examples
Last synced: 2 months ago
JSON representation
Examples of Dockerfiles and Singularity recipes
- Host: GitHub
- URL: https://github.com/kaczmarj/container-examples
- Owner: kaczmarj
- Created: 2021-08-12T03:27:51.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-12T14:31:40.000Z (almost 4 years ago)
- Last Synced: 2025-02-10T03:23:06.462Z (4 months ago)
- Language: Dockerfile
- Size: 2.93 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# container examples
# build with docker
## bedtools.Dockerfile
```
docker build --tag bedtools --file bedtools.Dockerfile .
```## conda.Dockerfile
```
docker build --tag conda --file conda.Dockerfile .
```### running jupyter notebook
please note that we set `--ip 0.0.0.0`. and we need to publish the port from the
container onto the host. otherwise, the port is only accessible inside the container
and will not be seen by our web browser (which is outside of the container).```
docker run --rm -it --publish 8888:8888 conda --port 8888 --ip 0.0.0.0 --no-browser
```## tensorflow24.Dockerfile
```
docker build --tag tensorflow:2.4 --file tensorflow24.Dockerfile .
```## python-env
this is an example of building a docker image for a python environment. that directory
includes a `requirements.txt` file, which lists dependencies. we copy that file into
the docker image when it is being built, and we install the python packages listed
there.```
docker build --tag mypyenv python-env
```# build with singularity
## python-env
this example builds a singularity image of `python-env`.
```
cd python-env
sudo singularity build python-env.sif Singularity
```example of running the image. arguments after the image name are passed to the
entrypoint. because our entrypoint is `python`, the command-line arguments are passed
to that.```
$ singularity run python-env.sif -c 'import numpy; print(numpy.__version__)'
1.21.1
```and here's an example to show that users stay themselves in containers...
remember, just be yourself.
```
$ singularity exec python-env.sif whoami
jakub
```this is not the case in docker. you need `sudo` to run the containers, so inside the
container, you can be root. this is not ideal, especially on shared clusters.