https://github.com/simnalamburt/docker-practice
My Dockerfile practice
https://github.com/simnalamburt/docker-practice
docker-image practice
Last synced: 4 months ago
JSON representation
My Dockerfile practice
- Host: GitHub
- URL: https://github.com/simnalamburt/docker-practice
- Owner: simnalamburt
- License: other
- Created: 2017-01-29T09:43:39.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-29T21:04:41.000Z (over 9 years ago)
- Last Synced: 2026-02-01T13:49:14.352Z (5 months ago)
- Topics: docker-image, practice
- Language: Python
- Size: 28.3 KB
- Stars: 2
- Watchers: 0
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
docker-practice
========
Docker image with python 2.7.13 + python 3.6.0 + mongodb 3.2. It's based on
Alpine Linux 3.5.
### Instructions
```shell
# Build image
sudo docker build -t docker-practice .
# Run image with psuedo-tty being attached to the screen
sudo docker run \
--interactive --tty \
--publish 12345:27017 \
--volume /srv/docker-practice/db:/data/db \
--rm --name docker-practice docker-practice
# Run image as a daemon
sudo docker run \
--detach \
--publish 12345:27017 \
--volume /srv/docker-practice/db:/data/db \
--rm --name docker-practice docker-practice
# Attach to the running docker image
sudo docker exec -it docker-practice /bin/sh
# Stop running docker container
sudo docker stop docker-practice
```
###### References
- [Use Supervisor with Docker](https://docs.docker.com/engine/admin/using_supervisord/), by docker team
- [github.com/jbfink/docker-wordpress](https://github.com/jbfink/docker-wordpress), a supervisord sample
- [Supervisor: A Process Control System](http://supervisord.org/), an official webpage
- [Python docker image](https://hub.docker.com/_/python/)
- [Alpine Linux package management - Add a Package](https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management#Add_a_Package), Alpine Linux wiki
- [`mongodb` package of Alpine Linux](https://pkgs.alpinelinux.org/package/edge/testing/x86_64/mongodb)
- [Dockerize MongoDB](https://docs.docker.com/engine/examples/mongodb/), by docker team
### Why would you do this? Why don't you just separate them into different containers?

*(laughs)*
--------
*docker-practice* is primarily distributed under the terms of both the [MIT license]
and the [Apache License (Version 2.0)]. See [COPYRIGHT] for details.
[MIT license]: LICENSE-MIT
[Apache License (Version 2.0)]: LICENSE-APACHE
[COPYRIGHT]: COPYRIGHT