Install/Docker

From Playful Exploration
Revision as of 21:05, 15 October 2016 by Peter (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Installation on Raspberian

Now simply:

curl -sSL https://get.docker.com | sh


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

...