Install/Docker: Difference between revisions
Jump to navigation
Jump to search
(Created page with "For installation instruction on Debian or any other OS see: * https://docs.docker.com/engine/installation/ The 'easiest' installation for Raspberian (I did not not tested) is...") |
No edit summary |
||
| Line 1: | Line 1: | ||
== Installation on Raspberian == | |||
The 'easiest' installation for Raspberian (I did not not tested) is this one: | The 'easiest' installation for Raspberian (I did not not tested) is this one: | ||
* https://resin.io/blog/docker-on-raspberry-pi-in-4-simple-steps/ | * https://resin.io/blog/docker-on-raspberry-pi-in-4-simple-steps/ | ||
| Line 11: | Line 9: | ||
#now run a playground image: | #now run a playground image: | ||
docker run -it --rm resin/rpi-raspbian /bin/bash | docker run -it --rm resin/rpi-raspbian /bin/bash | ||
== Installation on Debian or any other OS == | |||
* https://docs.docker.com/engine/installation/ | |||
== Running your first Playground Docker container == | == Running your first Playground Docker container == | ||
Revision as of 17:30, 26 June 2016
Installation on Raspberian
The 'easiest' installation for Raspberian (I did not not tested) is this one:
Steps:
curl https://raw.githubusercontent.com/resin-io/docker-install-script/master/install.sh | sh docker -d & sysctl -w net.ipv4.ip_forward=1 #now run a playground image: docker run -it --rm resin/rpi-raspbian /bin/bash
Installation on Debian or any other OS
Running your first Playground Docker container
docker run -it --rm debian /bin/bash
That's it! It will span a new debian container and run the bash shell in the container (notice the funky shell prompt with the container ID 6a464fb7f678 in my case). You can do here what ever you like without affecting the host. When done playing simply type exit and the container will destroy itself as if it never happened.
Output:
Unable to find image 'debian:latest' locally latest: Pulling from library/debian 5c90d4a2d1a8: Pull complete Digest: sha256:8b1fc3a7a55c42e3445155b2f8f40c55de5f8bc8012992b26b570530c4bded9e Status: Downloaded newer image for debian:latest root@6a464fb7f678:/#
Quick command overview
- docker run : All docker commands start with 'docker'. 'run' downloads the base image (if not already there) and spans a new instance (container) from that image
- -it: Is short to "-i -t" and runs the container in interactive mode so it will get the keyboard input.
- --rm : Destroys the container on exit.
- debian : Is the name of the image to download and run from the docker hub. 'debian' is a base Debian image with nothing pre-installed.
- /bin/bash : Is the command to run in the container i.e. run the bash shell.
Building a Container to keep
See also https://www.jamescoyle.net/how-to/1503-create-your-first-docker-container .
docker run -it --name NAME_YOUR_CONTAINER debian /bin/bash
...