mirror of
https://github.com/prodrigestivill/docker-postgres-backup-local.git
synced 2026-07-06 18:28:03 +00:00
Add build documentation
This commit is contained in:
@@ -0,0 +1,43 @@
|
|||||||
|
# postgres-backup-local build instructions
|
||||||
|
|
||||||
|
To build and push all images to it's own repository.
|
||||||
|
|
||||||
|
## Prepare environment
|
||||||
|
|
||||||
|
* Configure you system to use [Docker Buildx](https://docs.docker.com/buildx/working-with-buildx/).
|
||||||
|
* Prepare crosscompile environment (see below).
|
||||||
|
|
||||||
|
### Prepare crosscompile environment
|
||||||
|
|
||||||
|
In order to work in Arch Linux the following initialization commands will be required:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||||
|
docker buildx rm multibuilder
|
||||||
|
docker buildx create --name multibuilder --platform linux/amd64,linux/arm64,linux/arm/v7 --driver docker-container --use
|
||||||
|
docker buildx inspect --bootstrap
|
||||||
|
```
|
||||||
|
|
||||||
|
## Generate the images
|
||||||
|
|
||||||
|
### Generate build configuration
|
||||||
|
|
||||||
|
In order to modify the image name or any other configurable parameter run the `generate.sh` script.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
IMAGE_NAME="prodrigestivill/postgres-backup-local" ./generate.sh config.hcl
|
||||||
|
```
|
||||||
|
|
||||||
|
### Build the images
|
||||||
|
|
||||||
|
In order to only build the images locally run the following command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker buildx bake --pull -f config.hcl
|
||||||
|
```
|
||||||
|
|
||||||
|
In order to publish directly to the repository run this command instead:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker buildx bake --pull --set common.output=type=registry -f config.hcl
|
||||||
|
```
|
||||||
+15
-2
@@ -1,8 +1,21 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Usage: ./publish.sh [Version1] [Version2]...
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
./generate.sh
|
TMPFILE=$(mktemp)
|
||||||
|
trap 'rm -vf "$TMPFILE"' EXIT
|
||||||
|
|
||||||
docker buildx bake --pull --set common.output=type=registry
|
if [ -n "$@" ]; then
|
||||||
|
export TAGS="$@"
|
||||||
|
echo "Generate configuration for only this tags: $TAGS"
|
||||||
|
else
|
||||||
|
echo "Generate configuration for all predefined tags."
|
||||||
|
fi
|
||||||
|
./generate.sh "$TMPFILE"
|
||||||
|
echo "Generated docker bake HCL script at: $TMPFILE"
|
||||||
|
|
||||||
|
echo "Starting building and publish..."
|
||||||
|
docker buildx bake --pull --set common.output=type=registry -f "$TMPFILE"
|
||||||
|
|||||||
Reference in New Issue
Block a user