Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated seed.sh to build only for linux/amd64 by default. #75

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
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.
@@ -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}"