-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
528 additions
and
111 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,39 @@ | ||
# Builder | ||
FROM rust:slim-buster AS builder | ||
ARG BUILDER_DIR=/srv/bitmask | ||
ARG BUILDER_SRC=/opt/src/bitmask | ||
ARG SOURCE_CODE=https://github.com/diba-io/bitmask-core.git | ||
ARG VERSION=c18cba0375dbc4c2f2a5a4fe56401bf3d6d52ce7 | ||
|
||
RUN apt-get update -y && \ | ||
apt-get install -y pkg-config make g++ libssl-dev git | ||
|
||
WORKDIR $BUILDER_DIR | ||
WORKDIR $BUILDER_SRC | ||
RUN git clone $SOURCE_CODE $BUILDER_SRC | ||
RUN git checkout $VERSION | ||
RUN cargo install --locked --features server --path . --root ${BUILDER_DIR} | ||
|
||
# Runtime | ||
FROM rust:slim-buster AS runtime | ||
|
||
ARG BUILDER_DIR=/srv/bitmask | ||
ARG BIN_DIR=/usr/local/bin | ||
ARG DATA_DIR=/tmp/bitmaskd/carbonado/ | ||
ARG USER=bitmask | ||
|
||
RUN apt-get update -y && apt-get install -y iputils-ping telnet \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
RUN adduser --home "${DATA_DIR}" --shell /bin/bash --disabled-login \ | ||
--gecos "${USER} user" ${USER} | ||
|
||
COPY --from=builder --chown=${USER}:${USER} \ | ||
"${BUILDER_DIR}/bin/" "${BIN_DIR}" | ||
|
||
USER ${USER} | ||
VOLUME ${DATA_DIR} | ||
EXPOSE 7070 | ||
|
||
WORKDIR ${BIN_DIR} | ||
ENTRYPOINT ["bitmaskd"] |
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
Oops, something went wrong.