forked from criteo/haproxy-spoe-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fetch golang package during docker build
- Loading branch information
1 parent
9352137
commit a612fe5
Showing
3 changed files
with
23 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,16 @@ FROM golang:1.17 | |
|
||
# Using root user creates permission issues on the host, particularly with go.sum being regenerated within the container. | ||
RUN useradd -s /bin/bash -m -U dev | ||
USER dev | ||
|
||
RUN go get github.com/cespare/reflex | ||
RUN go install github.com/go-delve/delve/cmd/[email protected] | ||
RUN go install github.com/cespare/[email protected] | ||
|
||
WORKDIR /usr/app | ||
ADD go.mod go.mod | ||
ADD go.sum go.sum | ||
RUN go mod download | ||
RUN chown -R dev /usr/app | ||
|
||
USER dev | ||
|
||
ENTRYPOINT ["/scripts/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,4 @@ | |
|
||
set -x | ||
|
||
go get github.com/go-delve/delve/cmd/dlv | ||
|
||
reflex -r '(\.go$|go\.mod|\.sh|\.yaml|\.yml)' -s -- $* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
#!/bin/bash | ||
|
||
echo "Running agent along with dlv debugging server" | ||
/scripts/run-with-debug.sh haproxy-spoe-auth cmd/haproxy-spoe-auth/main.go -- \ | ||
-config /configuration/config.yml \ | ||
if [[ "$DEBUG_ENABLED" -eq "1" ]] | ||
then | ||
echo "Running agent along with debug server" | ||
/scripts/run-with-debug.sh haproxy-spoe-auth cmd/haproxy-spoe-auth/main.go -- \ | ||
-config /configuration/config.yml | ||
else | ||
while true | ||
do | ||
echo "Running agent without debug server" | ||
go run cmd/haproxy-spoe-auth/main.go -config /configuration/config.yml | ||
sleep 2 | ||
done | ||
fi |