-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dockerfile: Pass flags via enviroment variable (#16)
* Dockerfile: pass env vars to flags in entrypoint Signed-off-by: tiero <[email protected]> * Dockerfile: skip debian warning Signed-off-by: tiero <[email protected]> * envars.Dockerfiles Signed-off-by: tiero <[email protected]> Signed-off-by: tiero <[email protected]>
- Loading branch information
Showing
2 changed files
with
39 additions
and
2 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
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
FROM golang:1.18-buster AS builder | ||
|
||
ENV GO111MODULE=on \ | ||
CGO_ENABLED=0 | ||
|
||
WORKDIR /tor-proxy | ||
|
||
COPY go.mod . | ||
COPY go.sum . | ||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
|
||
RUN go build -o torproxy ./cmd/*.go | ||
|
||
WORKDIR /bin | ||
|
||
RUN cp /tor-proxy/torproxy . | ||
|
||
FROM debian:buster-slim | ||
|
||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates | ||
|
||
COPY --from=builder /bin/torproxy /usr/local/bin/torproxy | ||
|
||
RUN chmod a+x /usr/local/bin/torproxy | ||
|
||
RUN useradd -ms /bin/bash torproxy | ||
|
||
USER torproxy | ||
|
||
# Prevents `VOLUME $HOME/.local/` being created as owned by `root` | ||
RUN mkdir -p "$HOME/.local/" | ||
|
||
|
||
ENTRYPOINT torproxy start --insecure --port="${PORT}" --registry="${REGISTRY_URL}" --socks5-hostname="${SOCKS5_HOSTNAME}" --socks5-port="${SOCKS5_PORT}" | ||
|