Skip to content

Commit

Permalink
support using podman instead of docker
Browse files Browse the repository at this point in the history
podman has many advantages over docker (e.g. rootless by default), this
allows falling back to podman if the docker command is not present.
  • Loading branch information
craftyguy committed Sep 16, 2022
1 parent 16dcdb9 commit a1a343d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
11 changes: 7 additions & 4 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

set -e

docker run -it --name zmk zmk
docker cp zmk:/app/firmware/ ./
docker stop zmk
docker rm zmk
container_cmd="docker"
command -v "$container_cmd" || container_cmd="podman"

"$container_cmd" run -it --name zmk zmk
"$container_cmd" cp zmk:/app/firmware/ ./
"$container_cmd" stop zmk
"$container_cmd" rm zmk
5 changes: 4 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

set -e

docker build --tag zmk .
container_cmd="docker"
command -v "$container_cmd" || container_cmd="podman"

"$container_cmd" build --tag zmk .

0 comments on commit a1a343d

Please sign in to comment.