Skip to content

ouisharelabs/docker-known

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-known

Run the Known social publishing platform in a Docker container!

This unofficial image uses the 0.6.4 ("Dunham") release of Known. It has been designed to run one process per container, i.e.:

  • one container used as data volume
  • MySQL database running in one container (based on the standard MySQL image)
  • Apache running the Known PHP application in a container based on this image

How to run it

You can run it the easy way or the hard(er) way. Let's start with the hard(er) way.

First, create a data volume container

The data volume container will contain the MySQL database files and the Known uploads directory (for uploaded photos, etc.):

docker run --name datavolume \
    -v /var/lib/mysql \
    -v /var/www/known/uploads \
    -d ubuntu:trusty true

Second, start the MySQL database server

Here you need to decide on passwords for the MySQL root user and for the MySQL user account for the Known app:

docker run --name mysql --volumes-from datavolume \
    -e MYSQL_DATABASE=known \
    -e MYSQL_USER=known \
    -e MYSQL_PASSWORD=knownpassword \
    -e MYSQL_ROOT_PASSWORD=rootpassword \
    -d mysql

Third, start the actual Known app

Again, you need to pass in the MySQL information you decided on in the previous step:

docker run --name known --volumes-from datavolume --link mysql:mysql -p 80:80 \
    -e MYSQL_DATABASE=known \
    -e MYSQL_USER=known \
    -e MYSQL_PASSWORD=knownpassword \
    -d ehdr/known

Notes:

  • the --link alias for the MySQL container (the part after the ':') must be exactly mysql
  • the current version of Known (0.6.4) only supports running on port 80

How to run it using Fig

Fig offers a convenient way to start all the containers automatically. Once you have Fig installed, just put something like the following in a fig.yml file and run fig up (but promise to pick good passwords first!):

datavolume:
  image: ubuntu:trusty
  volumes:
    - /var/lib/mysql
    - /var/www/known/uploads

mysql:
  image: mysql
  volumes_from:
    - datavolume
  environment:
    - MYSQL_DATABASE=known
    - MYSQL_USER=known
    - MYSQL_PASSWORD=knownpassword
    - MYSQL_ROOT_PASSWORD=rootpassword

known:
  image: ehdr/known
  volumes_from:
    - datavolume
  environment:
    - MYSQL_DATABASE=known
    - MYSQL_USER=known
    - MYSQL_PASSWORD=knownpassword
  ports:
    - "80:80"
  links:
    - "mysql:mysql"

Finally, set up Known!

Enter the Known site address into your browser, and follow the instructions.

If you are running docker locally on your machine, you should be able to access it at http://localhost/. If you are running boot2docker, you instead need to enter the local IP of your boot2docker virtual machine, which you can find by running

boot2docker ip

How to build it

To build the image locally, simply

docker build -t ehdr/known .

About

Run the Known social publishing platform in a Docker container!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%