diff --git a/Dockerfile b/Dockerfile index 6e579496..b25d1f9b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -146,6 +146,7 @@ RUN mkdir -p ${STAGING_DEBIAN} ${STAGING_SBIN} ${STAGING_BIN} ${STAGING_BASE}/et echo "cartesi-machine" > ${staging_base}/etc/hostname COPY control ${STAGING_DEBIAN}/control +COPY postinst ${STAGING_DEBIAN}/postinst COPY --from=builder ${BUILD_BASE}/tools/sys-utils/cartesi-init/cartesi-init ${STAGING_SBIN} COPY --from=c-builder ${BUILD_BASE}/tools/sys-utils/xhalt/xhalt ${STAGING_SBIN} diff --git a/fs/Dockerfile b/fs/Dockerfile index ab3dbfc7..1bca238d 100644 --- a/fs/Dockerfile +++ b/fs/Dockerfile @@ -48,7 +48,6 @@ RUN apt-get update && \ file=1:5.41-3ubuntu0.1 \ /tmp/${TOOLS_DEB} \ && \ - useradd --create-home --user-group dapp && \ rm -rf /var/lib/apt/lists/* /tmp/${TOOLS_DEB} COPY --chown=root:root --from=cross-builder /tmp/build-extra/benchmarks/whetstone /usr/bin/ COPY --chown=root:root --from=cross-builder /tmp/build-extra/benchmarks/dhrystone /usr/bin/ diff --git a/postinst b/postinst new file mode 100755 index 00000000..dd0cc47b --- /dev/null +++ b/postinst @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +USER_NAME="dapp" + +# Check if the user already exists +if ! getent passwd $USER_NAME > /dev/null; then + useradd --create-home --user-group $USER_NAME +fi + +exit 0