From 6b6919d935ce9656499e210d9025cde199e5adc3 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 3 Dec 2024 11:47:46 +1100 Subject: [PATCH] Updated `seed.sh` to build only for `linux/amd64` by default. --- README.md | 15 ++++++++++----- seed.sh | 3 ++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b185b45..b79ae9d 100644 --- a/README.md +++ b/README.md @@ -53,16 +53,21 @@ imports. ## Seeding image with your database -`./seed.sh` allows to easily create your own image with a "seeded" database. - +1. Download the `seed.sh` script from this repository: ```shell -./seed.sh path/to/db.sql myorg/myimage:latest # Build and push an image to the registry +curl -O https://github.com/drevops/mariadb-drupal-data/releases/latest/download/seed.sh +chmod +x seed.sh ``` - -In some cases, shell may report platform incorrectly. Run with forced platform: +2. Run the script with the path to your database dump and the image name: ```shell +./seed.sh path/to/db.sql myorg/myimage:latest + +# or with forced platform DOCKER_DEFAULT_PLATFORM=linux/amd64 ./seed.sh path/to/db.sql myorg/myimage:latest + +# for multi-platform image +DESTINATION_PLATFORMS=linux/amd64,linux/arm64 ./seed.sh path/to/db.sql myorg/myimage:latest ``` Note that you should already be logged in to the registry as `seed.sh` will be pushing an image. diff --git a/seed.sh b/seed.sh index ca22e04..ec7a894 100755 --- a/seed.sh +++ b/seed.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash ## # Seed image with a database from file. +# @see https://github.com/drevops/mariadb-drupal-data/blob/main/seed.sh # # The seeding process has 3-phases: # 1. Create extracted DB files by starting a temporary container and importing the database. @@ -34,7 +35,7 @@ BASE_IMAGE="${BASE_IMAGE:-drevops/mariadb-drupal-data:latest}" DOCKER_DEFAULT_PLATFORM="${DOCKER_DEFAULT_PLATFORM:-}" # Destination platforms to build for. -DESTINATION_PLATFORMS="${DESTINATION_PLATFORMS:-linux/amd64,linux/arm64}" +DESTINATION_PLATFORMS="${DESTINATION_PLATFORMS:-linux/amd64}" # Log directory on host to store container logs. LOG_DIR="${LOG_DIR:-.logs}"