Docker: Difference between revisions
Brian Wilson (talk | contribs) mNo edit summary |
Brian Wilson (talk | contribs) mNo edit summary |
||
Line 22: | Line 22: | ||
apt-get install docker-engine | apt-get install docker-engine | ||
== Metadata == | |||
Get an id: | |||
docker ps | |||
Look at a container in detail | |||
docker inspect ''id'' | |||
See also /var/lib/docker/containers/''id'' | |||
== Docker networking == | |||
Check ifconfig docker0 to see what the bridge address is on your docker server | |||
then as needed create a route on your router so that traffic can flow from your local computers | |||
into the docker instances running on the docker server. | |||
If you have more than one docker server you have to make sure they don't both pick the same network ip range. | |||
If routes are already set up in the router docker should be able to find an unused subnet. | |||
Revision as of 23:13, 23 November 2016
Docker is a container platform.
It's open source but if you go to the site, you won't be able to tell, you can just find out about pricing there. After looking at docker.com, go to https://github.com/docker/docker and look for installation instructions there.
I am following their instructions to install on two Debian systems, one co-located and one at home.
I want to set up containers for Geonode and Geoserver.
I know how fiddly Geoserver can be (it runs in Tomcat) and so I want to isolate it from the Debian host it will run on.
I already have PostgreSQL 9.5 running directly on the host, but my only intended use is as a backend for PostGIS/Geoserver, so I will probably follow along with the instructions here and containerize it too.
So in preparation for using Docker. I removed PostgreSQL and Tomcat from my host server.
Orchestrating Geoserver with Docker and Fig
I have no idea what Fig is, yet.
Docker Hub
apt-get install docker-engine
Metadata
Get an id:
docker ps
Look at a container in detail
docker inspect id
See also /var/lib/docker/containers/id
Docker networking
Check ifconfig docker0 to see what the bridge address is on your docker server then as needed create a route on your router so that traffic can flow from your local computers into the docker instances running on the docker server.
If you have more than one docker server you have to make sure they don't both pick the same network ip range. If routes are already set up in the router docker should be able to find an unused subnet.
sudo docker pull nginx
cd static-html-directory cat <<EOF > nginx.docker FROM nginx COPY static-html-directory /usr/share/nginx/html EOF
Place this file in the same directory as your directory of content ("static-html-directory"), run ., then start your container:
docker run --name some-nginx -d some-content-nginx
sudo docker pull php
sudo docker pull redis
sudo docker pull tomcat