forked from AcalaNetwork/subway
-
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.
* Docker config * Update .dockerignore
- Loading branch information
Showing
3 changed files
with
6 additions
and
17 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
target/ | ||
Dockerfile |
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,33 +1,21 @@ | ||
FROM rust:buster as builder | ||
FROM rust:1.74-buster as builder | ||
WORKDIR /app | ||
|
||
COPY . . | ||
ADD . . | ||
|
||
RUN cargo build --release --verbose | ||
|
||
# ============= | ||
|
||
FROM phusion/baseimage:focal-1.2.0 | ||
LABEL maintainer="[email protected]" | ||
FROM ubuntu:22.04 | ||
|
||
RUN useradd -m -u 1000 -U -s /bin/sh -d /app docker | ||
|
||
WORKDIR /app | ||
|
||
RUN apt-get update && apt-get install tini | ||
|
||
COPY --from=builder /app/target/release/subway /usr/local/bin | ||
COPY ./config.yml /app/config.yml | ||
|
||
# checks | ||
RUN ldd /usr/local/bin/subway && \ | ||
/usr/local/bin/subway --version | ||
|
||
# Shrinking | ||
RUN rm -rf /usr/lib/python* && \ | ||
rm -rf /usr/sbin /usr/share/man | ||
|
||
USER docker | ||
EXPOSE 9944 | ||
|
||
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/subway"] | ||
ENTRYPOINT ["/usr/local/bin/subway"] |
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