Skip to content

Commit

Permalink
Add variable and pull the LXD image
Browse files Browse the repository at this point in the history
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
  • Loading branch information
afbjorklund committed Jul 10, 2024
1 parent 88741fe commit cf3ea95
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions hack/test-lxd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,21 @@ if [ "$#" -ne 2 ]; then
fi

INSTANCE="$1"
IMAGE="ubuntu:24.04"
FILE="$2"
NAME="$(basename -s .yaml "$FILE")"

sudo lxc version

INFO "Validating \"$FILE\""
limactl validate "$FILE"

INFO "Creating \"$NAME\" from \"$FILE\""
limactl --tty=false create --cpus=1 --memory=1 "$FILE"

sudo lxc init ubuntu:24.04 "$INSTANCE" --config limits.cpu=1 --config limits.memory=1GiB
sudo lxc version
sudo lxc image copy "$IMAGE" local:

INFO "LXC: Creating \"$INSTANCE\" from \"$IMAGE\""
sudo lxc init "$IMAGE" "$INSTANCE" --config limits.cpu=1 --config limits.memory=1GiB

INFO "LXC: Starting \"$INSTANCE\""
sudo lxc start "$INSTANCE"
Expand Down

0 comments on commit cf3ea95

Please sign in to comment.