/alpine-grav

Grav running on Alpine Linux [Docker]

Primary LanguageDockerfile

Grav container image running on Alpine Linux

Docker Automated build Docker Pulls Docker Stars

Alpine Version Grav Version

This container image (yobasystems/alpine-grav) is based on the minimal Alpine Linux ready for running Grav (Flat file CMS)

Alpine Version 3.19.1 (Released 2023-01-26)

Grav Version 1.7.45

Table of Contents

🏔️ What is Alpine Linux?

Alpine Linux is a Linux distribution built around musl libc and BusyBox. The image is only 5 MB in size and has access to a package repository that is much more complete than other BusyBox based images. This makes Alpine Linux a great image base for utilities and even production applications. Read more about Alpine Linux here and you can see how their mantra fits in right at home with container images.

✨ Features

  • Minimal size only, minimal layers
  • Memory usage is minimal on a simple install.

🏗️ Architectures

  • :amd64, :x86_64 - 64 bit Intel/AMD (x86_64/amd64)
  • :arm64v8, :aarch64 - 64 bit ARM (ARMv8/aarch64)
  • :arm32v7, :armhf - 32 bit ARM (ARMv7/armhf)

📝 PLEASE CHECK TAGS BELOW FOR SUPPORTED ARCHITECTURES, THE ABOVE IS A LIST OF EXPLANATION

🏷️ Tags

  • :latest latest branch based (Automatic Architecture Selection)
  • :master master branch usually inline with latest
  • :deliver-site deliver-site branch based (Automatic Architecture Selection)
  • :one-page one-page branch based (Automatic Architecture Selection)
  • :amd64, :x86_64 amd64 based on latest tag but amd64 architecture
  • :aarch64, :arm64v8 Armv8 based on latest tag but arm64 architecture
  • :armhf, :arm32v7 Armv7 based on latest tag but arm32 architecture

📏 Layers & Sizes

Version MicroBadger Layers (tag) MicroBadger Size (tag)

Version MicroBadger Layers (tag) MicroBadger Size (tag)

Version MicroBadger Layers (tag) MicroBadger Size (tag)

🚀 How to use this image

Environment Variables:

Creating an instance

mkdir -p /data/{domain}/html

docker run -e VIRTUAL_HOST={domain}.com,www.{domain}.com -v /data/{domain}/html:/usr/html -p 80:80 yobasystems/alpine-grav

E.G

mkdir -p /data/yobasystems/html

docker run -e VIRTUAL_HOST=www.yobasystems.co.uk -v /data/yobasystems/html:/usr/html -p 80:80 yobasystems/alpine-grav

Make sure you create the folder on the host before starting the container and obtain the correct permissions.

mkdir -p /data/{domain}/html

docker run -e VIRTUAL_HOST={domain}.com,www.{domain}.com -v /data/{domain}/html:/usr/html -p 80:80 yobasystems/alpine-grav

E.G

mkdir -p /data/yobasystems/html

docker run -e VIRTUAL_HOST=www.yobasystems.co.uk -v /data/yobasystems/html:/usr/html -p 80:80 yobasystems/alpine-grav

The following user and group id are used, the files should be set to this: User ID: Group ID:

chown -R 100:101 /data/{domain}/html

E.G

chown -R 100:101 /data/yobasystems/html

The container image will auto create the folder and populate with files if it doesn't exist. Make sure to mount /data/{domain}/html with your Backup files.

The following user and group id are used, the files should be set to this: User ID: Group ID:

chown -R 100:101 /data/{domain}/html

Volume structure

  • /usr/html: Webroot

GRAV CLI GPM

Grav includes a GPM (Grav Package Manager) which allows you to install, update, uninstall and list all the themes and plugins available on the Grav repository, as well as upgrade Grav itself to the latest version. Its best to su nginx before executing anything or else you can potentially compromise your host.

docker exec -it <container_name> bash
su nginx
cd /usr/html
bin/gpm list

Upload limit

The upload limit is 128 Megabytes.

Change php.ini value

modify files/php-fpm.conf

To modify php.ini variable, simply edit php-fpm.ini and add php_flag[variable] = value.

php_flag[display_errors] = on

PHP Modules

List of available modules in Alpine Linux, not all these are installed.

In order to install a php module do, (leave out the version number i.e. -8.1.01-r0
docker exec <image_id> apk add <pkg_name>
docker restart <image_name>

Example:

docker exec <image_id> apk add php81-soap
docker restart <image_name>
php81-common
php81-pdo_sqlite
php81-pear
php81-ftp
php81-imap
php81-mysqli
php81-json
php81-mbstring
php81-soap
php81-litespeed
php81-sockets
php81-bcmath
php81-opcache
php81-dom
php81-zlib
php81-gettext
php81-fpm
php81-intl
php81-openssl
php81-session
php81-pecl-mcrypt
php81-pdo_mysql
php81-embed
php81-xmlrpc
php81-wddx
php81-dba
php81-ldap
php81-xsl
php81-exif
php81-pdo_dblib
php81-bz2
php81-pdo
php81-pspell
php81-sysvmsg
php81-gmp
php81-apache2
php81-pdo_odbc
php81-shmop
php81-ctype
php81-phpdbg
php81-enchant
php81-sysvsem
php81-sqlite3
php81-odbc
php81-pcntl
php81-calendar
php81-xmlreader
php81-snmp
php81-zip
php81-posix
php81-iconv
php81-curl
php81-doc
php81-gd
php81-xml
php81-dev
php81-cgi
php81-sysvshm
php81-pgsql
php81-tidy
php81-pdo_pgsql
php81-phar
php81-mysqlnd

Docker Compose example:

grav:
  image: yobasystems/alpine-grav:latest
  environment:
    VIRTUAL_HOST: www.example.co.uk
  expose:
    - "80"
  volumes:
    - /data/example/www:/usr/html
  restart: always

🔍 Image contents & Vulnerability analysis

PACKAGE NAME PACKAGE VERSION VULNERABILITIES

📚 Source Repositories

🐳 Container Registries

🔗 Links

💰 Donation

BMAC

BITCOIN

ETHEREUM