Skip to content

Commit

Permalink
set defaults to support running router in Docker without compose
Browse files Browse the repository at this point in the history
  • Loading branch information
qrkourier committed Mar 8, 2024
1 parent 3bd92b6 commit 5ca6a1e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions dist/dist-packages/linux/openziti-router/entrypoint.bash
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ set -x # for debugging
# shellcheck disable=SC1090 # default path is set by the systemd service
source "${ZITI_ROUTER_BOOTSTRAP_BASH:-/opt/openziti/etc/router/bootstrap.bash}"
# if no args or first arg is "run", bootstrap the router with the config file path as next arg, or default "config.yml"
if [[ $# -eq 0 || ${1} == run ]]; then
bootstrap "${2:-}"
if [ "${1:-run}" == run ]; then
bootstrap "${2:-config.yml}"
fi

# shellcheck disable=SC2068
exec ziti router ${@}
exec ziti router ${@:-run config.yml}
9 changes: 8 additions & 1 deletion dist/docker-images/ziti-router/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@ RUN INSTALL_PKGS="util-linux iptables" && \

# set a var for entrypoint.bash to find this script
ENV ZITI_ROUTER_BOOTSTRAP_BASH=/bootstrap.bash
ENV ZITI_ROUTER_TYPE=edge
ENV ZITI_ROUTER_ADVERTISED_PORT=3022
ENV ZITI_BOOTSTRAP_CONFIG=true
ENV ZITI_BOOTSTRAP_ENROLLMENT=true
ENV PFXLOG_NO_JSON=true
COPY ./dist/dist-packages/linux/openziti-router/bootstrap.bash ${ZITI_ROUTER_BOOTSTRAP_BASH}

COPY ./dist/dist-packages/linux/openziti-router/entrypoint.bash /

WORKDIR /ziti-router
RUN chown -R ziggy:ziggy /ziti-router

# run as ziggy (2171:2171) by default, override run-as user with root when DOCKER_ROUTER_MODE=tproxy
USER ziggy

Expand Down

0 comments on commit 5ca6a1e

Please sign in to comment.