diff --git a/Dockerfile b/Dockerfile index 52c9fc3..fe86de8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,12 +35,8 @@ RUN apk upgrade --no-cache --available \ # Copy artifacts from builder container COPY --from=builder /build/trafficmirror /trafficmirror -# Create non-root user -RUN addgroup -S -g 1000 stackstate && \ - adduser -S -u 1000 -G stackstate -s /bin/sh stackstate - # Switch to non-root user -USER stackstate +USER nobody EXPOSE 8080 diff --git a/rootfs/docker-entrypoint.sh b/rootfs/docker-entrypoint.sh index 785a714..91d4e19 100755 --- a/rootfs/docker-entrypoint.sh +++ b/rootfs/docker-entrypoint.sh @@ -13,10 +13,11 @@ set -e extraParams="${1}" listenPort="${LISTEN_PORT:-8080}" main="${MAIN:-localhost:8888}" +passwordFile="${PASSWORD_FILE:-/tmp/password.file}" if [ -n "${USERNAME}" ]; then - echo "${USERNAME}:${PASSWORD}" > /password.file - extraParams="${extraParams} -password /password.file" + echo "${USERNAME}:${PASSWORD}" > "${passwordFile}" + extraParams="${extraParams} -password ${passwordFile}" fi /trafficmirror -listen ":${listenPort}" -main="${main}" "${extraParams}"