Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix webtls in Docker #3114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
client/webserver/site/node_modules/
spec/
docs/
5 changes: 3 additions & 2 deletions client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build
FROM debian:buster-slim
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates
WORKDIR /dex
ENV HOME /dex
ENV HOME=/dex
RUN mkdir -p /dex/.dexc && chown 1000 /dex/.dexc
USER 1000
COPY --from=gobuilder /root/dex/client/cmd/bisonw/bisonw ./
COPY --from=gobuilder /root/dex/client/cmd/bwctl/bwctl ./
COPY ./client/entrypoint.sh ./
EXPOSE 5758
CMD [ "./bisonw", "--webaddr=0.0.0.0:5758" ]
ENTRYPOINT [ "./entrypoint.sh" ]
5 changes: 3 additions & 2 deletions client/Dockerfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build
FROM debian:buster-slim
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates
WORKDIR /dex
ENV HOME /dex
ENV HOME=/dex
RUN mkdir -p /dex/.dexc && chown 1000 /dex/.dexc
USER 1000
COPY --from=gobuilder /root/dex/client/cmd/bisonw/bisonw ./
COPY --from=gobuilder /root/dex/client/cmd/bwctl/bwctl ./
COPY ./client/entrypoint.sh ./
EXPOSE 5758
CMD [ "./bisonw", "--webaddr=0.0.0.0:5758" ]
ENTRYPOINT [ "./entrypoint.sh" ]
11 changes: 11 additions & 0 deletions client/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

# Get the IP address of the primary network interface
IP_ADDRESS=$(hostname -I | awk '{print $1}')

CMD="./bisonw"
if [ "$IP_ADDRESS" != "" ]; then
CMD="$CMD --webaddr $IP_ADDRESS:5758"
fi

exec $CMD
Loading