Skip to content

Commit

Permalink
Merge pull request #11 from flatcar/compose
Browse files Browse the repository at this point in the history
Add docker compose CLI plugin sysext
  • Loading branch information
pothos authored May 23, 2023
2 parents e68d2fe + b146553 commit 43ae18b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions create_docker_compose_sysext.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
set -euo pipefail

export ARCH="${ARCH-x86_64}"
SCRIPTFOLDER="$(dirname "$(readlink -f "$0")")"

if [ $# -lt 2 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo "Usage: $0 VERSION SYSEXTNAME"
echo "The script will download the docker compose CLI plugin binary (e.g., for 2.18.1) and create a sysext squashfs image with the name SYSEXTNAME.raw in the current folder."
echo "A temporary directory named SYSEXTNAME in the current folder will be created and deleted again."
echo "All files in the sysext image will be owned by root."
echo "To use arm64 pass 'ARCH=aarch64' as environment variable (current value is '${ARCH}')."
"${SCRIPTFOLDER}"/bake.sh --help
exit 1
fi

VERSION="$1"
SYSEXTNAME="$2"

rm -rf "${SYSEXTNAME}"
mkdir -p "${SYSEXTNAME}"/usr/local/lib/docker/cli-plugins
curl -o "${SYSEXTNAME}"/usr/local/lib/docker/cli-plugins/docker-compose -fsSL "https://github.com/docker/compose/releases/download/v${VERSION}/docker-compose-linux-${ARCH}"
chmod +x "${SYSEXTNAME}"/usr/local/lib/docker/cli-plugins/docker-compose
"${SCRIPTFOLDER}"/bake.sh "${SYSEXTNAME}"
rm -rf "${SYSEXTNAME}"

0 comments on commit 43ae18b

Please sign in to comment.