Docker: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
mNo edit summary
Brian Wilson (talk | contribs)
Line 41: Line 41:
If routes are already set up in the router docker should be able to find an unused subnet.  
If routes are already set up in the router docker should be able to find an unused subnet.  


 
docker pull nginx
sudo docker pull nginx


cd ''static-html-directory''
cd ''static-html-directory''
Line 54: Line 53:
  docker run --name some-nginx -d some-content-nginx
  docker run --name some-nginx -d some-content-nginx


I want one Docker machine to run Owncloud, so it will have to have


# Nginx
# php 7
# Redis
# Owncloud


Owncloud will use MySQL for data storage so MySQL server has to run elsewhere.


sudo docker pull php
FROM nginx
sudo docker pull redis
MAINTAINER Brian Wilson <[email protected]>
sudo docker pull tomcat
USER root

Revision as of 06:20, 28 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.

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

I want one Docker machine to run Owncloud, so it will have to have

  1. Nginx
  2. php 7
  3. Redis
  4. Owncloud

Owncloud will use MySQL for data storage so MySQL server has to run elsewhere.

FROM nginx MAINTAINER Brian Wilson <[email protected]> USER root