Skip to content

Commit

Permalink
Updating alpine to the latest
Browse files Browse the repository at this point in the history
- PHP has been updated to 8.1
- Updated Matomo to 4.12.3
- Removed Customization for JNA
- Removed the demo image as it is unmaintained and doesn't support php 8.1
- Created test image for testing changes to isle-buildkit (includes sample content)
  • Loading branch information
nigelgbanks committed Nov 9, 2022
1 parent 219677c commit eeb306c
Show file tree
Hide file tree
Showing 175 changed files with 59,793 additions and 364 deletions.
37 changes: 37 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Provide environment variables for configuring docker-compose, *not* the
# containers themselves.
#
# Note that this is simple string assignment, quotes should *not* be used.
# Multiple lines or commands, or bash syntax will not work.
#
# References:
# - https://docs.docker.com/compose/env-file/
# - https://docs.docker.com/compose/reference/envvars/
COMPOSE_PROJECT_NAME=isle-buildkit

# Use buildkit when building images.
COMPOSE_DOCKER_CLI_BUILD=1
DOCKER_BUILDKIT=1

# Required for traefik on OSX (inconsistent behavior).
DOCKER_CLIENT_TIMEOUT=120
COMPOSE_HTTP_TIMEOUT=120

# The consistency requirements for bind mounts; one of:
#
# - consistent: Full consistency. The container runtime and the host maintain an identical view of the mount at all times.
# - cached: The host's view of the mount is authoritative. There may be delays before updates made on the host are visible within a container.
# - delegated: The container runtime's view of the mount is authoritative. There may be delays before updates made in a container are visible on the host.
#
# Note that using 'consistent' can be very slow.
CONSISTENCY=delegated

# The Docker image repository, to use for isle-buildkit images.
#
# "local" is produced by building isle-buildkit manually
# "islandora" is pulled from DockerHub.
#
REPOSITORY=local

# The version of the isle-buildkit images to use.
TAG=latest
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
/build
scratch
scratch.md
volumes
/docker-compose.yml
volumes
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,35 @@
"composer": "shellscript"
},
"cSpell.words": [
"autoconfigure",
"autowire",
"binarystorage",
"Blazegraph",
"CAROOT",
"catchable",
"classpath",
"Confd",
"crond",
"elif",
"fastcgi",
"FCREPO",
"filesize",
"getenv",
"homarus",
"islandora",
"JNA",
"jsonld",
"KEEPALIVE",
"Matomo",
"mkcert",
"MODESHAPE",
"nativeplatform",
"nocopy",
"POSTGRESQL",
"proxied",
"rootfs",
"SIGTERM",
"traefik",
"xdebug"
]
}
86 changes: 63 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [Build All Images](#build-all-images)
- [Build Specific Image](#build-specific-image)
- [Building Continuously](#building-continuously)
- [Testing](#testing)
- [Running](#running)
- [Docker Images](#docker-images)
- [Design Considerations](#design-considerations)
Expand All @@ -29,7 +30,7 @@ consumed by [isle-dc] and can be used by other Docker orchestration tools such
as Swarm / Kubernetes.

It is **not** meant as a starting point for new users or those unfamiliar with
Docker, or basic server adminstration.
Docker, or basic server administration.

If you are looking to use islandora please read the
[official documentation](https://islandora.github.io/documentation/) and use
Expand Down Expand Up @@ -149,6 +150,57 @@ When this is combined with the use of ``watchtower`` and
``restart: unless-stopped`` in a ``docker-compose.yml`` file. Images will be
redeployed with the latest changes while you develop automatically.

## Testing

There are a number of automated tests that are included in this repository which
can be found in the `tests` folders of each docker image project.

To run these tests use the following command:

```bash
./gradlew test
```

To manually test changes in a functioning environment use the command:

```bash
./gradlew up
```

This will bring up the environment based on
<https://github.com/Islandora/islandora-starter-site>. When completed a message
will print like so:

```
For all services the credentials are:
Username: admin
Password: password
The following services can be reached at the given URLs:
ActiveMQ: https://activemq.islandora.dev/
Blazegraph: https://blazegraph.islandora.dev/bigdata/
Drupal: https://islandora.dev/
Fedora: https://fcrepo.islandora.dev/fcrepo/rest/
Matomo: https://islandora.dev/matomo/index.php
Solr: https://solr.islandora.dev/solr/#/
Traefik: https://traefik.islandora.dev/dashboard/#/
```

To destroy this environment use the following command:

```bash
./gradlew down
```

The two commands can be used at once to ensure you are starting from a clean
environment:

```bash
./gradlew down up
```

## Running

There is no method for running the containers in `isle-buildkit`, instead please
Expand All @@ -166,7 +218,6 @@ The following docker images are provided:
- [cantaloupe](./cantaloupe/README.md)
- [crayfish](./crayfish/README.md)
- [crayfits](./crayfits/README.md)
- [demo](./demo/README.md)
- [drupal](./drupal/README.md)
- [fcrepo](./fcrepo/README.md)
- [fits](./fits/README.md)
Expand All @@ -184,6 +235,7 @@ The following docker images are provided:
- [postgresql](./postgresql/README.md)
- [recast](./recast/README.md)
- [solr](./solr/README.md)
- [test](./test/README.md)
- [tomcat](./tomcat/README.md)

Many are intermediate images used to build other images in the list, for example
Expand Down Expand Up @@ -347,7 +399,7 @@ are arranged in a hierarchy, that roughly follows below:
│ └── recast
├── crayfits
├── drupal
│ └── demo
│ └── test
└── matomo
```

Expand Down Expand Up @@ -405,29 +457,17 @@ successfully start without any other container present. Additionally it ensure
that the order of precedence for configuration settings.

This does not completely remove dependencies between containers, for example,
when the [demo](../docker/demo/README.md) starts it requires a running
[fcrepo](../docker/fcrepo/README.md) to be able to ingest nodes created by
``islandora_default`` features. In these cases an initialization script can
block until another container is available or a timeout has been reached. For
example:
when the [fcrepo6](./fcrepo6/README.md) starts it requires a running database
like [mariadb](./mariadb/README.md) to be able to start. In these cases an
initialization script can block until another container is available or a
timeout has been reached. For example:

```bash
local fcrepo_url=

# Indexing fails if port 80 is given explicitly.
if [[ "${DRUPAL_DEFAULT_FCREPO_PORT}" == "80" ]]; then
fcrepo_url="http://${DRUPAL_DEFAULT_FCREPO_HOST}/fcrepo/rest/"
else
fcrepo_url="http://${DRUPAL_DEFAULT_FCREPO_HOST}:${DRUPAL_DEFAULT_FCREPO_PORT}/fcrepo/rest/"
fi

#...

# Need access to Solr before we can actually import the right config.
if timeout 300 wait-for-open-port.sh "${DRUPAL_DEFAULT_FCREPO_HOST}" "${DRUPAL_DEFAULT_FCREPO_PORT}" ; then
echo "Fcrepo Found"
# Need access to database to start wait up to 5 minutes (i.e 300 seconds).
if timeout 300 wait-for-open-port.sh "${DB_HOST}" "${DB_PORT}" ; then
echo "Database Found"
else
echo "Could not connect to Fcrepo"
echo "Could not connect to Database"
exit 1
fi
```
Expand Down
2 changes: 1 addition & 1 deletion abuild/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1.2.1
ARG repository=local
ARG tag=latest
ARG alpine=3.15.0
ARG alpine=3.16.2
FROM ${repository}/download:${tag} AS download
FROM alpine:${alpine} AS cache
FROM alpine:${alpine}
Expand Down
2 changes: 1 addition & 1 deletion base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1.2.1
ARG repository=local
ARG tag=latest
ARG alpine=3.15.0
ARG alpine=3.16.2
FROM ${repository}/download:${tag} AS download
FROM alpine:${alpine} AS cache
FROM alpine:${alpine}
Expand Down
65 changes: 64 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,66 @@
plugins {
id("com.github.nigelgbanks.IsleDocker") version "0.11"
id("com.github.nigelgbanks.IsleDocker") version "0.11"
}

// Include any folder that has a Dockerfile as a sub-project.
val buildTasks = rootProject.projectDir
.walk()
.maxDepth(1) // Only immediate directories.
.filter { it.isDirectory && it.resolve("Dockerfile").exists() } // Must have a Dockerfile.
.map { directory ->
// Include as a sub-project.
directory.relativeTo(rootProject.projectDir).path + ":build"
}.toList().toTypedArray()

val down by tasks.registering(Exec::class) {
commandLine("docker", "compose", "down", "-v")
}

val wait by tasks.registering(Exec::class) {
commandLine(
"docker",
"compose",
"exec",
"drupal",
"timeout",
"600",
"bash",
"-c",
"while ! test -f /installed; do sleep 5; done"
)
doLast {
logger.quiet(
"""
For all services the credentials are:
Username: admin
Password: password
The following services can be reached at the given URLs:
ActiveMQ: https://activemq.islandora.dev/
Blazegraph: https://blazegraph.islandora.dev/bigdata/
Drupal: https://islandora.dev/
Fedora: https://fcrepo.islandora.dev/fcrepo/rest/
Matomo: https://islandora.dev/matomo/index.php
Solr: https://solr.islandora.dev/solr/#/
Traefik: https://traefik.islandora.dev/dashboard/#/
""".trimIndent()
)
}
}

tasks.register<Exec>("up") {
commandLine("docker", "compose", "up", "-d")
dependsOn("generateCerts", *buildTasks)
mustRunAfter(down)
finalizedBy(wait)
}

// Do not show output unless requested.
allprojects {
tasks.configureEach {
logging.captureStandardOutput(LogLevel.INFO)
logging.captureStandardError(LogLevel.INFO)
}
}
2 changes: 1 addition & 1 deletion cantaloupe/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1.2.1
ARG repository=local
ARG tag=latest
ARG alpine=3.15.0
ARG alpine=3.16.2
FROM --platform=$BUILDPLATFORM ${repository}/download:${tag} AS download

ARG CANTALOUPE_VERSION="4.1.5"
Expand Down
4 changes: 2 additions & 2 deletions cantaloupe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ additional settings, volumes, ports, etc.

## Settings

| Environment Variable | Confd Key | Default |
| Environment Variable | Confd Key | Default |
| :------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- | :--------------------------------------------------------- |
| CANTALOUPE_HTTP_ENABLED | /cantaloupe/http/enabled | true |
| CANTALOUPE_HTTP_HOST | /cantaloupe/http/host | 0.0.0.0 |
Expand Down Expand Up @@ -166,7 +166,7 @@ additional settings, volumes, ports, etc.
| CANTALOUPE_REDACTION_ENABLED | /cantaloupe/redaction/enabled | false |
| CANTALOUPE_METADATA_PRESERVE | /cantaloupe/metadata/preserve | false |
| CANTALOUPE_METADATA_RESPECT_ORIENTATION | /cantaloupe/metadata/respect/orientation | false |
| CANTALOUPE_LOG_APPLICATION_LEVEL | /cantaloupe/log/application/level | debug |
| CANTALOUPE_LOG_APPLICATION_LEVEL | /cantaloupe/log/application/level | info |
| CANTALOUPE_LOG_APPLICATION_CONSOLEAPPENDER_ENABLED | /cantaloupe/log/application/consoleappender/enabled | true |
| CANTALOUPE_LOG_APPLICATION_FILEAPPENDER_ENABLED | /cantaloupe/log/application/fileappender/enabled | false |
| CANTALOUPE_LOG_APPLICATION_FILEAPPENDER_PATHNAME | /cantaloupe/log/application/fileappender/pathname | /opt/tomcat/logs/cantaloupe.application.log |
Expand Down
4 changes: 2 additions & 2 deletions code-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1.2.1
ARG repository=local
ARG tag=latest
ARG alpine=3.15.0
ARG alpine=3.16.2
FROM alpine:${alpine} AS cache
FROM node:fermium-alpine3.15 as node
FROM ${repository}/abuild:${tag} AS build
Expand Down Expand Up @@ -89,7 +89,7 @@ RUN sed -i "/nginx:x:100:101:nginx:\/var\/lib\/nginx:\/sbin\/nologin/cnginx:x:10
RUN --mount=type=cache,id=code-server-drupal-apk,sharing=locked,from=cache,target=/var/cache/apk \
apk --update add \
htop \
php7-pecl-xdebug \
php81-pecl-xdebug \
spdlog \
sudo \
unison \
Expand Down
4 changes: 2 additions & 2 deletions code-server/rootfs/etc/nginx/shared/drupal.fpm.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Allow for toggling between xdebug / production configured fpm.
set $fpm php-fpm7;
set $fpm php-fpm81;
if ($cookie_XDEBUG_SESSION) {
set $fpm xdebug;
}
Expand All @@ -23,6 +23,6 @@ location ~ '\.php$|^/update.php' {
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
# PHP 7 socket location.
fastcgi_pass unix:/var/run/$fpm/php-fpm7.sock;
fastcgi_pass unix:/var/run/$fpm/php-fpm81.sock;
}

6 changes: 3 additions & 3 deletions code-server/rootfs/etc/services.d/xdebug/run
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ set -e

XDEBUG_FLAGS=$(</var/run/s6/container_environment/XDEBUG_FLAGS)

exec /usr/sbin/php-fpm7 \
--pid /var/run/xdebug/php-fpm7.pid \
exec /usr/sbin/php-fpm81 \
--pid /var/run/xdebug/php-fpm81.pid \
--prefix /var/run/xdebug \
--fpm-config /etc/php7/php-fpm.conf \
--fpm-config /etc/php81/php-fpm.conf \
-d php_admin_value[zend_extension]=xdebug.so \
-d zend_extension=xdebug.so \
${XDEBUG_FLAGS}
4 changes: 4 additions & 0 deletions code-server/tests/ServiceStartsWithDefaults/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import tasks.tests.ServiceStartsWithDefaultsTest
tasks.register<ServiceStartsWithDefaultsTest>("test") {
waitForMessage.set("NOTICE: ready to handle connections")
}
Loading

0 comments on commit eeb306c

Please sign in to comment.