Code Monkey home page Code Monkey logo

docker-grav's Introduction

Official Docker Image for Grav

This currently is pretty minimal and uses:

  • apache-2.4.38
  • GD library
  • Unzip library
  • php7.4
  • php7.4-opcache
  • php7.4-acpu
  • php7.4-yaml
  • cron
  • vim editor

Persisting data

To save the Grav site data to the host file system (so that it persists even after the container has been removed), simply map the container's /var/www/html directory to a named Docker volume or to a directory on the host.

If the mapped directory or named volume is empty, it will be automatically populated with a fresh install of Grav the first time that the container starts. However, once the directory/volume has been populated, the data will persist and will not be overwritten the next time the container starts.

Building the image from Dockerfile

docker build -t grav:latest .

Running Grav Image with Latest Grav + Admin:

docker run -p 8000:80 grav:latest

Point browser to http://localhost:8000 and create user account...

Running Grav Image with Latest Grav + Admin with a named volume (can be used in production)

docker run -d -p 8000:80 --restart always -v grav_data:/var/www/html grav:latest

Running Grav Image with docker-compose and a volume mapped to a local directory

Running docker-compose up -d with the following docker-compose configuration will automatically build the Grav image (if the Dockerfile is in the same directory as the docker-compose.yml file). Then the Grav container will be started with all of the site data persisted to a named volume (stored in the ./grav directory.

volumes:
  grav-data:
    driver: local
    driver_opts:
      type: none
      device: $PWD/grav
      o: bind

services:
  grav:
    build: ./
    ports:
      - 8080:80
    volumes:
      - grav-data:/var/www/html

docker-grav's People

Contributors

eloquentcarbon avatar frunika avatar hartmnt avatar jkuester avatar johnmica avatar magikcypress avatar mathieugery avatar pgrimaud avatar pwallrich avatar rhukster avatar rotzbua avatar rouja avatar simjost avatar w00fz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-grav's Issues

can't pull/build docker-file

#6
Sorry, there is no URL for building the docker-image. I tried things like
docker build -t grav:latest https://github.com/getgrav/docker-grav etc in OMV 4, but without success.
Could You please update the readme? The image of garywiz/docker-grav unfortunately has some errors, makes no sense to me...
Thank You!!

Improvements

This is currently a simple php72-apache based image, but there's definitely lots of room for improvements.

Some things I would like to get added

  • Nginx rather than Apache (perhaps Nginx reverse proxy to Apache for .htaccess support?)
  • Ability to specify stable/testing release of Grav to be pulled.
  • Ability to specify a github repo to pull from and build out.
    • Skeleton Support - Basically the user/ folder in repo, so would clone/install Grav then clone the skeleton repo, and run bin/grav install to get the dependencies installed
    • Full Site Support - This is where an entire site is stored in git, so should be just a simple clone
  • Ability to easily execute CLI commands
  • Ability to easily shell to container and do stuff
  • Resolve permissions issues. Currently the site installs as www-data user but the volume mounts as root. Saves via volumes seem to map back to user ok, but still feels dirty.
  • LetsEncrypt SSL support
  • Docker Compose to provide data-persistence in the container
  • Checkout Treatys Image - https://github.com/getmedia-digital/grav-docker

Anything else i'm missing?

podman build

Hi,

because it exists, I try to run the image via podman v2.2.1. For that I need to build it. But during build process on the task

RUN pecl install apcu \
    && pecl install yaml-2.0.4 \
    && docker-php-ext-enable apcu yaml

I'm getting this output and the build process stops. I think it asked for user input.

STEP 6: RUN pecl install apcu     && pecl install yaml-2.0.4     && docker-php-ext-enable apcu yaml
downloading apcu-5.1.19.tgz ...
Starting to download apcu-5.1.19.tgz (96,583 bytes)
.....................done: 96,583 bytes
45 source files, building
running: phpize
Configuring for:
PHP Api Version:         20190902
Zend Module Api No:      20190902
Zend Extension Api No:   320190902
Enable internal debugging in APCu [no] : 

Nothing happens - it waits. I can't find any command switch like -yes or -no in pecl. I know, that is maybe not your issue, but maybe you've an idea.

Question:Using existing data with docker-grav

Hi,

Please excuse my ignorance!

How do we get all our data from an existing grav site (i.e. "/user") sync'd to the docker-grav container? Will this continue to sync as we dev? Have I misunderstood how this works?

Again, my apologies for asking daft questions, I'm new to docker.

Error ShortcodeUiTwigExtension not found !

Hi,

On last GRAV update (and plugin), when I tried to create a new plugin, I got :

Fatal error: Uncaught Error: Class 'Grav\Plugin\ShortcodeUi\ShortcodeUiTwigExtension' not found in /site/user/plugins/shortcode-ui/shortcode-ui.php:45

best,

FAILED to read problem after upgrading

Thank you very much for your work, we are using grav to build the site for a long time.s
But in a recent update there was a problem, I updated a very old grav version(<1.6) to the latest version and had the following problem:
Failed to read en.yaml: Duplicate key
"INVALID_FRONTMATTER_COULD_NOT_SAVE" detected at line 510 (near "INVALID_FRONTMATTER_COULD_NOT_SAVE: "Invalid frontmatter, could not save"").

I thought it was a permissions issue, but after checking, I found that my permissions were fine: www-data is the user running the server and the owner of the file.
Can you help me to figure out what i should do? I've been working on this whole day. Thank again for you attention.

apache2: Could not reliably determine the server's fully qualified domain name

Hi everyone,

grav_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using local-ip (10,192,127..) Set the 'ServerName' directive globally to suppress this message
grav_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using ocal-ip (10,192,127..) Set the 'ServerName' directive globally to suppress this message
grav_1 | [Wed Sep 29 19:27:17.895031 2021] [mpm_prefork:notice] [pid 9] AH00163: Apache/2.4.48 (Debian) configured -- resuming normal operations
grav_1 | [Wed Sep 29 19:27:17.896093 2021] [core:notice] [pid 9] AH00094: Command line: 'apache2 -D FOREGROUND'

here my docker-compose.yaml :

volumes:
grav-data:
driver: local
driver_opts:
type: none
device: ./grav
o: bind

services:
grav:
networks:
- frontend
- backend
restart: always
environment:
# Change this to the domain your Wordpress site should be served on.
VIRTUAL_HOST: my.web.site
# If you want to use LetsEncrypt on this domain, uncomment these and update them.
LETSENCRYPT_HOST: web.site
LETSENCRYPT_EMAIL: [email protected]
build: ./
hostname: web
volumes:
- ./grav-data:/var/www/html

networks:
Frontend:
external: true
backend:
driver: bridge

how to add umask?

Hi, I'd like to edit user files in persistent storage by adding my user to the www-data group. However, this cointaner is created with 755 permissions on user files. and new Grav files follow it as well.

Building causes Forbidden error

Steps to recreate:

  1. create folder: mkdir -p /volume2/docker/grav/html
  2. git clone the repo to /volume2/docker/grav
  3. edit the docker-compose file
    `version: '3.3'
    services:
    grav:
    container_name: grav
    build: ./
    ports:
    • 8080:80
      volumes:
    • /volume2/docker/grav/html:/var/www/html`
  4. run docker-compose: sudo docker-compose build .
  5. (maybe) run docker-compose up -d

Themes do not work except Quark

I am new to Grav, set it up and running with docker image, by following instructions in Readme.

docker run -d -p 8000:80 --restart always -v grav_data:/var/www/html grav:latest

Once I add a theme and activate new theme, it showing lots of code on the site page like below, how can I fix the problem? Thanks.

截屏2021-07-20 上午10 05 32

Git workflow

Good day.

Can someone assist me with this issue?

I have just started using the Grav CMS and I'm also quite a newbie with Docker. I managed to set up everything on my local and have even managed to create some themes and plugins.

I'm now having challenges on how to create a git workflow that would enable me to save my work including the custom themes and plugins.

My question is what is the BEST WAY to have a local dev setup which enables me commit and push my work to a remote repo?

Upgrade Dockerfile from PHP 7.4 to PHP 8.0

Hey there, this Dockerfile was a great starting point for my use case. Thank you for that!

Nevertheless I was forced to upgrade php because some of my project dependencies needed php 8.0.
Fortunately GRAV 1.7.x perfectly runs with php 8.0.

In case anybody has to match the same requirements I'm sharing my experience with you. Maybe it helps.

What I did:

1. Change PHP Version

In first line of Dockerfile I simply changed the image FROM php:7.4-apache to FROM php:8.0-apache. That's the beauty of the php docker image.

2. Build fails

Then you get an error during build for pecl install apcu:

RUN pecl install apcu \
    && pecl install yaml-2.0.4 \
    && docker-php-ext-enable apcu yaml

The reason should be the following:
√php-apcu-bc: This can be dropped, nothing depends on it any longer.: https://wiki.ubuntu.com/ServerTeam/Transition/Php8.0

I simply commented the lines out.

3. Add JIT

Everything seems to be working fine but I'm wondering if in matters of performance it makes sense to enable JIT in PHP 8.0. Therefore I added two JIT settings at the end of ini settings. Not tested jet if it really improves performance.:

## Set recommended PHP.ini settings
## See https://secure.php.net/manual/en/opcache.installation.php
RUN { \
    echo 'opcache.memory_consumption=128'; \
    echo 'opcache.interned_strings_buffer=8'; \
    echo 'opcache.max_accelerated_files=4000'; \
    echo 'opcache.revalidate_freq=2'; \
    echo 'opcache.fast_shutdown=1'; \
    echo 'opcache.enable_cli=1'; \
    echo 'upload_max_filesize=128M'; \
    echo 'post_max_size=128M'; \
    echo 'expose_php=off'; \
    echo 'opcache.jit_buffer_size=100M'; \
    echo 'opcache.jit=1235'; \
    } > /usr/local/etc/php/conf.d/php-recommended.ini

Can anybody give me feedback if I'm doing it right? And maybe my suggestions are useful for future updates of this repository. It seems that in the future GRAV will make the step to php 8.0 as a minimum requirement (https://getgrav.org/blog/raising-php-requirements-2020).

Have a great day,

Johnnie

grav-admin-${GRAV_VERSION}.zip is "Not found"

Building the Dockerfile gives me an error when it tries to execute lines 59-62

RUN curl -o grav-admin.zip -SL https://getgrav.org/download/core/grav-admin/${GRAV_VERSION} && \
    unzip grav-admin.zip && \
    mv -T /var/www/grav-admin /var/www/html && \
    rm grav-admin.zip

GRAV_VERSION is set to latest and points to https://github.com/getgrav/grav/releases/download/1.7.11/grav-admin-v1.7.11.zip
which does not exist. The latest release as of today (2021-04-15) should point to https://github.com/getgrav/grav/releases/download/1.7.10/grav-admin-v1.7.10.zip

Bind html to a directory doesn't work

My docker-compose file:
version: '3.3' services: grav: build: ./ container_name: grav ports: - '880:80' restart: always volumes: - '/root/grav/html:/var/www/html' image: 'grav:latest' networks: default: name: test_net
If I run docker-compose up -d, or up --force-recreate --build -d, the html folder is always empty... resulting in a Forbidden error in the browser.

docker: Error response from daemon: pull access denied for getgrav/dockergrav

both

docker run -p 8000:80 grav:latest

and

docker run -p 8000:80 getgrav/dockergrav:latest

lead to

docker: Error response from daemon: pull access denied for getgrav/dockergrav, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.

It appears the repo isn't in dockerhub. But then the docs are incomplete.

How to stop the running docker image?

Hello, I followed the documentation to run a docker image but when I try to stop it with Ctrl+C in the terminal, it doesn't work. The way I found is to open a new terminal, run docker container ls -a to find the running container and then run docker stop <id>. Is there a simpler way? Could it be documented in the readme?
It might be basic docker knowledge, sorry if that's the case, I'm new to it all.

Runtime Exception

Hello,

I'm using docker-compose as everything on my production server is managed by a nginx reverse proxy.

I'm not sure I understood well the installation instructions though:
I downloaded the latest Grav + Admin and unarchived it to /srv/doc-user

Here is the Grav bit of my docker-compose.yml:

doc-user:
    image: 'grav:latest'
    container_name: doc-user
    depends_on:
      - proxy
    volumes:
      - /srv/doc-user/:/var/www/html/:cached

I get the following error:

Fatal error: Uncaught RuntimeException: Creating directory '/var/www/html/cache/compiled/files' failed on error in /var/www/html/vendor/rockettheme/toolbox/File/src/File.php:423 Stack trace: #0 /var/www/html/vendor/rockettheme/toolbox/File/src/File.php(191): RocketTheme\Toolbox\File\File->mkdir('/var/www/html/c...') #1 /var/www/html/vendor/rockettheme/toolbox/File/src/File.php(319): RocketTheme\Toolbox\File\File->lock() #2 /var/www/html/vendor/rockettheme/toolbox/File/src/PhpFile.php(31): RocketTheme\Toolbox\File\File->save(Array) #3 /var/www/html/system/src/Grav/Common/File/CompiledFile.php(64): RocketTheme\Toolbox\File\PhpFile->save(Array) #4 /var/www/html/system/src/Grav/Common/Config/Setup.php(181): Grav\Common\File\CompiledYamlFile->content() #5 /var/www/html/system/src/Grav/Common/Processors/SiteSetupProcessor.php(18): Grav\Common\Config\Setup->init() #6 /var/www/html/system/src/Grav/Common/Grav.php(131): Grav\Common\Processors\SiteSetupProcessor->process() #7 /var/www/html/system/src/Grav/Common/Grav.php(370): Gra in /var/www/html/system/src/Grav/Common/File/CompiledFile.php on line 80

Any idea about what I'm doing wrong?

Scheduler : crontab configuration is missing

The crontab of the container based on the official docker image is missing the crontab configuration see issue getgrav/grav#3153

(crontab -l; echo "* * * * * cd /var/www/html;/usr/local/bin/php bin/grav scheduler 1>> /dev/null 2>&1") | crontab -

it would be nice if this command could be added to the default configuration.

Docker image with pre-built PHP

Currently official Grav Docker image is building PHP and its modules. This takes time. Grav installation itself usually takes couple of seconds, but all the PHP dependencies takes > 90% or more of build time.

Would you be willing to consider an image with already prebuilt platform dependencies? I have a working Grav Docker image built from ubi9 base and could share it.

It also has various parameters which can be used to change Apache/PHP configuration https://catalog.redhat.com/software/containers/ubi9/php-81/62e8e662f6d3d47e19779b01?architecture=amd64&image=6613b6fda253889111a3e07d&container-tabs=overview . Current image doesn't have these abilities.

Can't set GRAV_VERSION using environment variables

Problem

It is currently not possible to set the GRAV_VERSION variable without editing the Dockerfile by just using env variables.
The build process will always use GRAV_VERSION=latest no matter what option you specify. ENV type variables in the Dockerfile only matter in the container creation phase. [1]

Steps to reproduce
Try to build the image using
docker build --build-arg "GRAV_VERSION=1.6.31" -t grav:1.6.31 .

Expected
The resulting image will use Grav 1.6.31

Actual
The build process will use latest for the image anyway

Solution

The fix is trivial. By using ARG instead of ENV when declaring the variable, docker will allow the var to be changed at build time. [2]
If, for whatever reason, an ENV variable is also desired in the future, it can be added as well and initialized with the value of the ARG variable like this [3]:

# You can set VAR_A while building the image
# or leave it at the default
ARG VAR_A=5
# VAR_B gets the (overridden) value of VAR_A
ENV VAR_B $VAR_A

References:
[1] https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file
[2] https://docs.docker.com/engine/reference/commandline/build/#set-build-time-variables---build-arg
[3] https://vsupalov.com/docker-arg-vs-env/

build fails because grav-admin is offline

Dear developers,

i can not build this image anymore. I get the following error message when downloading grav-admin:

Step 11/15 : RUN curl -o grav-admin.zip -SL https://getgrav.org/download/core/grav-admin/${GRAV_VERSION} &&     unzip grav-admin.zip &&     mv -T /var/www/grav-admin /var/www/html &&     rm grav-admin.zip
 ---> Running in ae4d0a5e5f75
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1700    0  1700    0     0   3244      0 --:--:-- --:--:-- --:--:--  3238
Archive:  grav-admin.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of grav-admin.zip or
        grav-admin.zip.zip, and cannot find grav-admin.zip.ZIP, period.
Service 'grav_base' failed to build : The command '/bin/sh -c curl -o grav-admin.zip -SL https://getgrav.org/download/core/grav-admin/${GRAV_VERSION} &&     unzip grav-admin.zip &&     mv -T /var/www/grav-admin /var/www/html &&     rm grav-admin.zip' returned a non-zero code: 9

the download link for the grav admin plugin seems to be offline: https://getgrav.org/download/core/grav-admin/latest

Dockerfile won't build; Fails with PHP Warning

When running the provided docker build command, I get the following error when it gets to the pecl commands:
Step 6/16 : RUN pecl install apcu && pecl install yaml-2.0.4 && docker-php-ext-enable apcu yaml ---> Running in e2bede677c0a PHP Warning: Module 'intl' already loaded in Unknown on line 0

I honestly don't know much about PHP, and as it's all building within a Docker container, there's not much scrounging around my local system I can do. I don't have PHP installed locally, if that helps at all.

Many thanks in advance for the help!

Docker-grav with proxy

Hi,
I tried your container in a standalone machine. It worked great and I wont to use it in production.
But my production system is behind a proxy (https://github.com/evertramos/docker-compose-letsencrypt-nginx-proxy-companion) and every system is managed by this proxy.
Now I tried to generate a docker-compose file, to use your image with the proxy, but I don't have any rights for the connection.

Forbidden
You don't have permission to access / on this server.
Apache/2.4.25 (Debian) Server at *myURL Port 80

Please, help me. Where is my mistake?


version: '3'

services:
grav:
image: 'grav:latest'
volumes:
- ./data:/var/www/html
environment:
VIRTUAL_HOST: *myURL
LETSENCRYPT_HOST: *myURL
LETSENCRYPT_EMAIL: MAIL@PROVIDER
restart: always

networks:
default:
external:
name: webproxy

Fix build using PHP 7.2.20

New image was released for PHP 7.2-apache tag, new version is 7.2.20.

This image contains new version of FreeType 2: libfreetype6:amd64 (2.9.1-3)
Previous working version was: libfreetype6:amd64 (2.6.3-3.2) ...

QUICK FIX: You can enforce FROM php:7.2.19-apache image in your Dockerfile.

Error:

checking for FreeType 2... /usr/include/
checking whether to enable JIS-mapped Japanese font support in GD... no
If configure fails try --with-webp-dir=<DIR>
checking for jpeg_read_header in -ljpeg... yes
checking for png_write_image in -lpng... yes
If configure fails try --with-xpm-dir=<DIR>
configure: error: freetype-config not found.
Error: error building at step {Env:[PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PHPIZE_DEPS=autoconf 		dpkg-dev 		file 		g++ 		gcc 		libc-dev 		make 		pkg-config 		re2c PHP_INI_DIR=/usr/local/etc/php APACHE_CONFDIR=/etc/apache2 APACHE_ENVVARS=/etc/apache2/envvars PHP_EXTRA_BUILD_DEPS=apache2-dev PHP_EXTRA_CONFIGURE_ARGS=--with-apxs2 --disable-cgi PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2 PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2 PHP_LDFLAGS=-Wl,-O1 -Wl,--hash-style=both -pie GPG_KEYS=1729F83938DA44E27BA0F4D3DBDB397470D12172 B1B44D8F021E4E2D6021E995DC9FF8D3EE5AF27F PHP_VERSION=7.2.20 PHP_URL=https://www.php.net/get/php-7.2.20.tar.xz/from/this/mirror PHP_ASC_URL=https://www.php.net/get/php-7.2.20.tar.xz.asc/from/this/mirror PHP_SHA256=eff09da83e235c2ba25c85deea1d4f663bd71d50fd51ad11e1acebe26d733494 PHP_MD5=] Command:run Args:[apt-get update && apt-get install -y         unzip         libfreetype6-dev         libjpeg62-turbo-dev         libpng-dev         libyaml-dev         git     && docker-php-ext-install opcache     && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/     && docker-php-ext-install -j$(nproc) gd     && docker-php-ext-install zip] Flags:[] Attrs:map[] Message:RUN apt-get update && apt-get install -y         unzip         libfreetype6-dev         libjpeg62-turbo-dev         libpng-dev         libyaml-dev         git     && docker-php-ext-install opcache     && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/     && docker-php-ext-install -j$(nproc) gd     && docker-php-ext-install zip Original:RUN apt-get update && apt-get install -y         unzip         libfreetype6-dev         libjpeg62-turbo-dev         libpng-dev         libyaml-dev         git     && docker-php-ext-install opcache     && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/     && docker-php-ext-install -j$(nproc) gd     && docker-php-ext-install zip}: error while running runtime: exit status 1

Invalid Signal: SIGWINCH when building the Dockerfile on Windows

After cloning the repo and running docker build -t grav:latest . , I get the following output:

Sending build context to Docker daemon  185.9kB
Step 1/15 : FROM php:7.4-apache
7.4-apache: Pulling from library/php
6ec7b7d162b2: Pull complete
db606474d60c: Pull complete
afb30f0cd8e0: Pull complete
3bb2e8051594: Pull complete
4c761b44e2cc: Pull complete
c2199db96575: Pull complete
1b9a9381eea8: Pull complete
50450ffc67ee: Pull complete
4d1e5a768e83: Pull complete
5e8be0d1df16: Pull complete
7a6395859d40: Pull complete
7306499d3dce: Pull complete
fa6f0ba15ac6: Pull complete
Digest: sha256:e327f0a32c728b36e7fff9cd1e97874dfc8bd3cbc9e1db6c1b75e16800e5e46f
Status: Downloaded newer image for php:7.4-apache
 ---> fd505f1f4cd8
Step 2/15 : LABEL maintainer="Andy Miller <[email protected]> (@rhukster)"
Invalid signal: SIGWINCH

Any ideas how to fix?

configure: error: unrecognized options: --with-freetype, --with-jpeg

Hello, I run into this issue. Any ideas why?

configure: error: unrecognized options: --with-freetype, --with-jpeg ERROR: Service 'grav' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y --no-install-recommends unzip libfreetype6-dev libjpeg62-turbo-dev libpng-dev libyaml-dev libzip4 libzip-dev zlib1g-dev libicu-dev g++ git cron vim && docker-php-ext-install opcache && docker-php-ext-configure intl && docker-php-ext-install intl && docker-php-ext-configure gd --with-freetype --with-jpeg && docker-php-ext-install -j$(nproc) gd && docker-php-ext-install zip && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 1

crash when installing official ldap plugin

Once docker-grav is running, you login as admin and you ask to install login-ldap officiel plugin: crash !

  • To reproduce: build the grav image from official docker-grav docker file
  • Start container
  • create admin account
  • login as admin
  • install login-ldap official plugin

... then you got a PHP page stating about a critical situation because of missing the php-ldap module

I've been able to circumvent it through a manual install of php-ldap:

docker exec -it <container name> bash

apt-get install -y libldap2-dev
docker-php-ext-configure ldap --prefix=/usr/local/php
docker-php-ext-install ldap

exit

Container does not stop gracefully

The container image built by the Dockerfile in this repo results in a container that cannot be stopped gracefully (i.e. doesn't respond to SIGWINCH like the base apache-php image does).

Root cause: The CMD in the Dockerfile is not correctly launching apache2 as PID 1, so the stop signals never reach the apache2 process.

Fix: Change the final line in the Dockerfile to be: CMD ["sh", "-c", "cron && exec apache2-foreground"]

The "exec" is required so that apache2 replaces the shell as PID 1. It will then respond to SIGWINCH and gracefully stop.

For a better understanding of how to correctly deal with signals inside containers, see https://github.com/Yelp/dumb-init

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.