Skip to content

Commit b45496a

Browse files
committed
Merge branch 'dockerinit-podman'
2 parents ea03490 + 03a3e79 commit b45496a

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jlink-flash-factory-setup: | build
121121
jlink-flash-firmware-semihosting: | build
122122
JLinkExe -if SWD -device ATSAMD51J20 -speed 4000 -autoconnect 1 -CommanderScript ./build/scripts/firmware-semihosting.jlink
123123
dockerinit:
124-
docker build --pull --force-rm --no-cache -t shiftcrypto/firmware_v2 .
124+
./scripts/container.sh build --pull --force-rm --no-cache -t shiftcrypto/firmware_v2 .
125125
dockerdev:
126126
./scripts/dockerenv.sh
127127
dockerrel:

scripts/container.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
# Copyright 2023 Shift Crypto AG
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# This script wraps podman or docker or the specified container
17+
# runtime.
18+
19+
if [ -n "$CONTAINER_RUNTIME" ]; then
20+
RUNTIME="$CONTAINER_RUNTIME"
21+
elif command -v podman &>/dev/null; then
22+
RUNTIME=podman
23+
else
24+
RUNTIME=docker
25+
fi
26+
27+
$RUNTIME $@

0 commit comments

Comments
 (0)