mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-08-10 02:43:02 +02:00
docker: add gpio and spi groups
This commit is contained in:
+9
-2
@@ -5,6 +5,8 @@ ARG USER=repeater
|
||||
ARG GROUP=repeater
|
||||
ARG PUID=15888
|
||||
ARG PGID=15888
|
||||
ARG GPIO_GID=986
|
||||
ARG SPI_GID=989
|
||||
ARG TARGETARCH
|
||||
ARG YQ_VERSION=v4.40.5
|
||||
|
||||
@@ -16,7 +18,9 @@ ENV INSTALL_DIR=/opt/pymc_repeater \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYMC_REPEATER=${PACKAGE_VERSION} \
|
||||
PUID=${PUID} \
|
||||
PGID=${PGID}
|
||||
PGID=${PGID} \
|
||||
GPIO_GID=${GPIO_GID} \
|
||||
SPI_GID=${SPI_GID}
|
||||
|
||||
# Install runtime dependencies only
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
|
||||
@@ -45,7 +49,10 @@ RUN arch="${TARGETARCH:-}" \
|
||||
|
||||
# Create the group and user in order to run without root privileges
|
||||
RUN groupadd --gid "$PGID" "$GROUP" \
|
||||
&& useradd --uid "$PUID" --gid "$PGID" --home-dir "$HOME_DIR" --create-home --shell /usr/bin/bash "$USER"
|
||||
&& groupadd --gid "$GPIO_GID" gpio \
|
||||
&& groupadd --gid "$SPI_GID" spi \
|
||||
&& useradd --uid "$PUID" --gid "$PGID" --home-dir "$HOME_DIR" --create-home --shell /usr/bin/bash "$USER" \
|
||||
&& usermod -a -G gpio,spi "$USER"
|
||||
|
||||
# Create runtime directories
|
||||
RUN mkdir -p ${INSTALL_DIR} ${CONFIG_DIR} ${DATA_DIR} \
|
||||
|
||||
Reference in New Issue
Block a user