Skip to content

Commit

Permalink
Merge pull request #7 from StackVista/fix-PasswordFileLocation
Browse files Browse the repository at this point in the history
Fix password file location
  • Loading branch information
rb3ckers authored Sep 4, 2019
2 parents 8c3dcad + 0760024 commit 652621a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions rootfs/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

0 comments on commit 652621a

Please sign in to comment.