Skip to content

Commit 69395c2

Browse files
committed
fix: do not use build-arg at runtime
1 parent 354673f commit 69395c2

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

Dockerfile.alpine

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ FROM alpine
22
RUN apk update && apk add --no-cache linux-tools-usbip
33
RUN if [ ! -e /usr/share/hwdata/usb.ids ]; then mkdir -p /usr/share/hwdata && ln -s /dev/null /usr/share/hwdata/usb.ids; fi
44
ARG SERVICE
5-
COPY usbip-common.sh "${SERVICE}/init" /opt/usbip-${SERVICE}/
6-
CMD [ "/opt/usbip-${SERVICE}/init" ]
5+
ENV USBIP_HOME="/opt/usbip-${SERVICE}"
6+
COPY usbip-common.sh "${SERVICE}/init" "${USBIP_HOME}/"
7+
CMD exec "${USBIP_HOME}/init"

Dockerfile.bullseye

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FROM debian:bullseye-slim
22
RUN apt-get update && apt-get install -y usbip && apt-get clean
33
ARG SERVICE
4-
COPY usbip-common.sh "${SERVICE}/init" "/opt/usbip-${SERVICE}/"
5-
CMD [ "/opt/usbip-${SERVICE}/init" ]
4+
ENV USBIP_HOME="/opt/usbip-${SERVICE}"
5+
COPY usbip-common.sh "${SERVICE}/init" "${USBIP_HOME}/"
6+
CMD exec "${USBIP_HOME}/init"

Dockerfile.buster

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
FROM debian:buster-slim
22
RUN apt-get update && apt-get install -y usbip && apt-get clean
33
ARG SERVICE
4-
COPY usbip-common.sh "${SERVICE}/init" "/opt/usbip-${SERVICE}/"
4+
ENV USBIP_HOME="/opt/usbip-${SERVICE}"
5+
COPY usbip-common.sh "${SERVICE}/init" "${USBIP_HOME}/"
56
# bash is preferred over sh as workaround for
67
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=779416
78
# affected package is dash:0.5.10.2-5, fixed in 0.5.11
8-
CMD [ "bash", "/opt/usbip-${SERVICE}/init" ]
9+
CMD exec bash "${USBIP_HOME}/init"

build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/bin/sh
22
set -eu
3+
distros="${1:-*}"
34
dir="$(dirname "${0}")"
4-
find "${dir}" -maxdepth 1 -name 'Dockerfile.*' -printf '%f\n' \
5+
find "${dir}" -maxdepth 1 -name "Dockerfile.${distros}" -printf '%f\n' \
56
| while read file; do
67
distro="${file##Dockerfile.}"
78
find "${dir}" -maxdepth 1 -type d ! -iname ".*" -printf '%f\n' \

0 commit comments

Comments
 (0)