Skip to content

Commit

Permalink
Updated seed.sh to build only for linux/amd64 by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Dec 3, 2024
1 parent 99cd0e4 commit 6b6919d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion seed.sh
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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}"
Expand Down

0 comments on commit 6b6919d

Please sign in to comment.