Docker support #94

Closed
opened 2026-02-04 16:46:53 +03:00 by OVERLORD · 17 comments
Owner

Originally created by @solidnerd on GitHub (Apr 20, 2016).

Hey,
i would like to know if some plans to dockerize the application. I searched for it but i found nothing on the issue's and pr's. A cool guy made an dockerized version of bookstack but it seems to be outdated. I made a fork of it and refactored it to the latest docker related stuff. If you want to see it check it out under docker preview.

Let me know what you think about it.

Originally created by @solidnerd on GitHub (Apr 20, 2016). Hey, i would like to know if some plans to dockerize the application. I searched for it but i found nothing on the issue's and pr's. A cool guy made an dockerized version of bookstack but it seems to be outdated. I made a fork of it and refactored it to the latest docker related stuff. If you want to see it check it out under [docker preview](https://github.com/SolidNerd/docker-bookstack/tree/master). Let me know what you think about it.
Author
Owner

@thiesschneider commented on GitHub (Apr 21, 2016):

i like the idea! but i tried to install it on my webspace and it does not work. first i get an error 137 and when i start the composer again it just says: whooops something went wrong ;)

@thiesschneider commented on GitHub (Apr 21, 2016): i like the idea! but i tried to install it on my webspace and it does not work. first i get an error 137 and when i start the composer again it just says: whooops something went wrong ;)
Author
Owner

@solidnerd commented on GitHub (Apr 21, 2016):

Okay, the current problem is that image is not the correct one. I could publish it on Docker Hub later than it will work.

@solidnerd commented on GitHub (Apr 21, 2016): Okay, the current problem is that image is not the correct one. I could publish it on Docker Hub later than it will work.
Author
Owner

@thiesschneider commented on GitHub (Apr 21, 2016):

ah nice.... thx for the effort!

@thiesschneider commented on GitHub (Apr 21, 2016): ah nice.... thx for the effort!
Author
Owner

@solidnerd commented on GitHub (Apr 21, 2016):

I updated the branch and now should everything work. Let know if you get any issues.
The link in the comment is updated aswell. It's on a new branch.

@solidnerd commented on GitHub (Apr 21, 2016): I updated the branch and now should everything work. Let know if you get any issues. The link in the comment is updated aswell. It's on a new branch.
Author
Owner

@thiesschneider commented on GitHub (Apr 21, 2016):

I tried again and now i got an error 1 for the image. do i have to update the docker-composer.yml?

@thiesschneider commented on GitHub (Apr 21, 2016): I tried again and now i got an error 1 for the image. do i have to update the docker-composer.yml?
Author
Owner

@solidnerd commented on GitHub (Apr 21, 2016):

Yes. Your docker-compose.yml need to be look like this:

version: '2'
services:
  bookstack:
    image: solidnerd/bookstack
    depends_on:
      - db
    environment:
    - DB_HOST=db
    - DB_DATABASE=bookstack
    - DB_USERNAME=bookstack
    - DB_PASSWORD=secret
    ports:
    - "8080:80"
  db:
    image: mysql:5.7.12
    environment:
    - MYSQL_ROOT_PASSWORD=secret
    - MYSQL_DATABASE=bookstack
    - MYSQL_USER=bookstack
    - MYSQL_PASSWORD=secret
@solidnerd commented on GitHub (Apr 21, 2016): Yes. Your docker-compose.yml need to be look like this: ``` version: '2' services: bookstack: image: solidnerd/bookstack depends_on: - db environment: - DB_HOST=db - DB_DATABASE=bookstack - DB_USERNAME=bookstack - DB_PASSWORD=secret ports: - "8080:80" db: image: mysql:5.7.12 environment: - MYSQL_ROOT_PASSWORD=secret - MYSQL_DATABASE=bookstack - MYSQL_USER=bookstack - MYSQL_PASSWORD=secret ```
Author
Owner

@thiesschneider commented on GitHub (Apr 21, 2016):

now it looks good... thx!

@thiesschneider commented on GitHub (Apr 21, 2016): now it looks good... thx!
Author
Owner

@solidnerd commented on GitHub (Apr 21, 2016):

You are welcome !

@solidnerd commented on GitHub (Apr 21, 2016): You are welcome !
Author
Owner

@ssddanbrown commented on GitHub (Apr 21, 2016):

This is awesome 😃, Thanks @SolidNerd and also thanks @Kilhog.

I did try it yesterday but ran into the errors mentioned above, The new version worked perfectly though. It's awesome to see it just work. I've tried to create this before, If only to help my testing, but I ran into issues so thank you so much.

I've not had any plans to create an 'official' docker image just yet as I don't feel comfortable enough with docker to ensure correct configuration and security (Since I've only used it for a short time) but it is something I'd like to see. I'm fully happy to support people creating docker scripts like this though.

@ssddanbrown commented on GitHub (Apr 21, 2016): This is awesome :smiley:, Thanks @SolidNerd and also thanks @Kilhog. I did try it yesterday but ran into the errors mentioned above, The new version worked perfectly though. It's awesome to see it just work. I've tried to create this before, If only to help my testing, but I ran into issues so thank you so much. I've not had any plans to create an 'official' docker image just yet as I don't feel comfortable enough with docker to ensure correct configuration and security (Since I've only used it for a short time) but it is something I'd like to see. I'm fully happy to support people creating docker scripts like this though.
Author
Owner

@thiesschneider commented on GitHub (Apr 26, 2016):

hey @SolidNerd.
I am frequently running into the "whooops" issue.
Any Idea what I did wrong?
I changed the docker-compose.yml to this:

version: '2'
services: 
  bookstack: 
    image: solidnerd/bookstack 
    depends_on: 
      - db 
    environment: 
    - DB_HOST=db 
    - DB_DATABASE=bookstack
    - DB_USERNAME=bookstack
    - DB_PASSWORD=myownpassword
    ports:
    - "7070:80"
  db:
    image: mysql
    environment:
    - MYSQL_ROOT_PASSWORD=myownrootpw
    - MYSQL_DATABASE=bookstack
    - MYSQL_USER=bookstack
    - MYSQL_PASSWORD=myownpassword

do i HAVE to use the mysql version you suggest? (even when i use the version tag it run into that error)

thx!

@thiesschneider commented on GitHub (Apr 26, 2016): hey @SolidNerd. I am frequently running into the "whooops" issue. Any Idea what I did wrong? I changed the docker-compose.yml to this: ``` version: '2' services: bookstack: image: solidnerd/bookstack depends_on: - db environment: - DB_HOST=db - DB_DATABASE=bookstack - DB_USERNAME=bookstack - DB_PASSWORD=myownpassword ports: - "7070:80" db: image: mysql environment: - MYSQL_ROOT_PASSWORD=myownrootpw - MYSQL_DATABASE=bookstack - MYSQL_USER=bookstack - MYSQL_PASSWORD=myownpassword ``` do i HAVE to use the mysql version you suggest? (even when i use the version tag it run into that error) thx!
Author
Owner

@solidnerd commented on GitHub (Apr 26, 2016):

@senthai I tested your configuration and it's working for me. Do you have the latest image from me. When not try docker pull solidnerd/bookstack. After that isn't working could you provide me more information about your docker setup with the following commands. docker-compose --version and docker info.

@solidnerd commented on GitHub (Apr 26, 2016): @senthai I tested your configuration and it's working for me. Do you have the latest image from me. When not try `docker pull solidnerd/bookstack`. After that isn't working could you provide me more information about your docker setup with the following commands. `docker-compose --version` and `docker info`.
Author
Owner

@thiesschneider commented on GitHub (Apr 26, 2016):

hi... thx for your answer!
it is strange 🈂️
I see the loginscreen, but when I login it shows the "whoops" error (btw... funny name)

My docker-compose versions is the latest (as far as i know):
docker-compose version 1.6.2, build 4d72027

docker info

Containers: 8
Running: 7
Paused: 0
Stopped: 1
Images: 42
Server Version: 1.11.0
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 202
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge null host
Kernel Version: 3.16.0-4-amd64
Operating System: Debian GNU/Linux 8 (jessie)
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 23.6 GiB
Name: bla.domain.yeah
ID: SOMEID
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No memory limit support
WARNING: No swap limit support
WARNING: No kernel memory limit support
WARNING: No oom kill disable support
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support

many warnings????? 💃

@thiesschneider commented on GitHub (Apr 26, 2016): hi... thx for your answer! it is strange :sa: I see the loginscreen, but when I login it shows the "whoops" error (btw... funny name) My docker-compose versions is the latest (as far as i know): docker-compose version 1.6.2, build 4d72027 docker info > Containers: 8 > Running: 7 > Paused: 0 > Stopped: 1 > Images: 42 > Server Version: 1.11.0 > Storage Driver: aufs > Root Dir: /var/lib/docker/aufs > Backing Filesystem: extfs > Dirs: 202 > Dirperm1 Supported: true > Logging Driver: json-file > Cgroup Driver: cgroupfs > Plugins: > Volume: local > Network: bridge null host > Kernel Version: 3.16.0-4-amd64 > Operating System: Debian GNU/Linux 8 (jessie) > OSType: linux > Architecture: x86_64 > CPUs: 8 > Total Memory: 23.6 GiB > Name: bla.domain.yeah > ID: SOMEID > Docker Root Dir: /var/lib/docker > Debug mode (client): false > Debug mode (server): false > Registry: https://index.docker.io/v1/ > WARNING: No memory limit support > WARNING: No swap limit support > WARNING: No kernel memory limit support > WARNING: No oom kill disable support > WARNING: No cpu cfs quota support > WARNING: No cpu cfs period support many warnings????? :dancer:
Author
Owner

@solidnerd commented on GitHub (Apr 26, 2016):

Okay. The latest docker-compose version is 1.7.0. You could upgrade it and try it again. I will test it under a debian but this takes some time. I will give you feedback about the tests later.

@solidnerd commented on GitHub (Apr 26, 2016): Okay. The latest `docker-compose` version is `1.7.0`. You could upgrade it and try it again. I will test it under a debian but this takes some time. I will give you feedback about the tests later.
Author
Owner

@thiesschneider commented on GitHub (Apr 27, 2016):

did the update and have the same error.

@thiesschneider commented on GitHub (Apr 27, 2016): did the update and have the same error.
Author
Owner

@solidnerd commented on GitHub (Apr 27, 2016):

So, i guess that i could figured out a bug of the container, but this need more time to fix it. It has something todo with waiting step for the db. I did a "workaround" with restart:always and i updated your docker-compose file and for me its working under debian:

version: '2'
services:
  bookstack:
    image: solidnerd/bookstack
    restart: always
    depends_on:
      - db
    environment:
    - DB_HOST=db
    - DB_DATABASE=bookstack
    - DB_USERNAME=bookstack
    - DB_PASSWORD=myownpassword
    ports:
    - "7070:80"
    networks:
    - backend
  db:
    image: mysql
    restart: always
    environment:
    - MYSQL_ROOT_PASSWORD=myownrootpw
    - MYSQL_DATABASE=bookstack
    - MYSQL_USER=bookstack
    - MYSQL_PASSWORD=myownpassword
    volumes:
    - ./mysql:/var/lib/mysql
    networks:
    - backend

networks:
 backend:

It contains serveral changes.

  1. Both Containers will every time restart if they exited and when you restart your docker daemon they will restart aswell. I guess this will fix the "bug".
  2. I added a volume for the db. This should bring performance and persistence.
  3. Last step I replaced the network. docker-compose creates by default a network but this seems not working at the time for this setup.

Before you run docker-compose up please remove all old stuff (docker-compose rm --all). I hope i could help you. I will update my docker-compose file later.

@solidnerd commented on GitHub (Apr 27, 2016): So, i guess that i could figured out a bug of the container, but this need more time to fix it. It has something todo with waiting step for the db. I did a "workaround" with `restart:always` and i updated your docker-compose file and for me its working under debian: ``` version: '2' services: bookstack: image: solidnerd/bookstack restart: always depends_on: - db environment: - DB_HOST=db - DB_DATABASE=bookstack - DB_USERNAME=bookstack - DB_PASSWORD=myownpassword ports: - "7070:80" networks: - backend db: image: mysql restart: always environment: - MYSQL_ROOT_PASSWORD=myownrootpw - MYSQL_DATABASE=bookstack - MYSQL_USER=bookstack - MYSQL_PASSWORD=myownpassword volumes: - ./mysql:/var/lib/mysql networks: - backend networks: backend: ``` It contains serveral changes. 1. Both Containers will every time restart if they exited and when you restart your docker daemon they will restart aswell. I guess this will fix the "bug". 2. I added a volume for the db. This should bring performance and persistence. 3. Last step I replaced the network. `docker-compose` creates by default a network but this seems not working at the time for this setup. Before you run `docker-compose up` please remove all old stuff (`docker-compose rm --all`). I hope i could help you. I will update my docker-compose file later.
Author
Owner

@thiesschneider commented on GitHub (Apr 27, 2016):

Thx so much for your work!
I will test it ;)

edit: I removed everything and updated the docker-compose file. when I want to load the container it says: ERROR: In file './docker-compose.yml', network must be a mapping, not a NoneType.

I have to remove every

   networks:
    - backend
networks:  
backend:

entry in order to get the container running.
But: There is no "whoops" error for now ;)

@thiesschneider commented on GitHub (Apr 27, 2016): Thx so much for your work! I will test it ;) edit: I removed everything and updated the docker-compose file. when I want to load the container it says: ERROR: In file './docker-compose.yml', network must be a mapping, not a NoneType. I have to remove every ``` networks: - backend networks: backend: ``` entry in order to get the container running. But: There is no "whoops" error for now ;)
Author
Owner

@ssddanbrown commented on GitHub (Sep 18, 2016):

Hi @solidnerd,
Since the docs have been updated with a link to your docker setup I will go ahead and close this issue.

@ssddanbrown commented on GitHub (Sep 18, 2016): Hi @solidnerd, Since the [docs have been updated](https://www.bookstackapp.com/docs/admin/installation) with a link to your docker setup I will go ahead and close this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#94