-
Notifications
You must be signed in to change notification settings - Fork 619
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #855 from afbjorklund/clients
Add client wrappers for docker and podman, similar to nerdctl wrapper
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
set -eu | ||
: "${LIMA_INSTANCE:=docker}" | ||
: "${DOCKER:=docker}" | ||
|
||
if [ "$(limactl ls -q "$LIMA_INSTANCE" 2>/dev/null)" != "$LIMA_INSTANCE" ]; then | ||
echo "instance \"$LIMA_INSTANCE\" does not exist, run \`limactl start --name=$LIMA_INSTANCE template://docker\` to create a new instance" >&2 | ||
exit 1 | ||
fi | ||
DOCKER=$(command -v "$DOCKER" || true) | ||
if [ -n "$DOCKER" ]; then | ||
DOCKER_HOST=$(limactl list "$LIMA_INSTANCE" --format 'unix://{{.Dir}}/sock/docker.sock') | ||
export DOCKER_HOST | ||
exec "$DOCKER" "$@" | ||
else | ||
export LIMA_INSTANCE | ||
exec lima docker "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
set -eu | ||
: "${LIMA_INSTANCE:=podman}" | ||
: "${PODMAN:=podman}" | ||
|
||
if [ "$(limactl ls -q "$LIMA_INSTANCE" 2>/dev/null)" != "$LIMA_INSTANCE" ]; then | ||
echo "instance \"$LIMA_INSTANCE\" does not exist, run \`limactl start --name=$LIMA_INSTANCE template://podman\` to create a new instance" >&2 | ||
exit 1 | ||
fi | ||
PODMAN=$(command -v "$PODMAN" || true) | ||
if [ -n "$PODMAN" ]; then | ||
CONTAINER_HOST=$(limactl list "$LIMA_INSTANCE" --format 'unix://{{.Dir}}/sock/podman.sock') | ||
export CONTAINER_HOST | ||
exec "$PODMAN" --remote "$@" | ||
else | ||
export LIMA_INSTANCE | ||
exec lima podman "$@" | ||
fi |