Merge pull request #40 from paspo/new-dockerfile

test new Dockerfile with s6-overlay
This commit is contained in:
RustDesk 2022-06-20 23:54:37 +08:00 committed by GitHub
commit c87e7bc848
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 46 additions and 0 deletions

34
docker/Dockerfile Executable file
View File

@ -0,0 +1,34 @@
FROM rust:alpine AS builder
RUN \
apk -U add musl-dev git file make && \
git clone --depth=1 https://github.com/rustdesk/rustdesk-server.git /src && \
cd /src && \
cargo build -r --manifest-path /src/Cargo.toml
FROM busybox:stable
ARG S6_OVERLAY_VERSION=3.1.0.1
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
RUN \
tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz && \
tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz && \
rm /tmp/s6-overlay*.tar.xz
COPY rootfs /
COPY --from=builder /src/target/release/hbbr /usr/bin/hbbr
COPY --from=builder /src/target/release/hbbs /usr/bin/hbbs
COPY healthcheck.sh /usr/bin/healthcheck.sh
ENV RELAY relay.example.com
EXPOSE 21115 21116 21116/udp 21117 21118 21119
HEALTHCHECK --interval=10s --timeout=5s CMD /usr/bin/healthcheck.sh
WORKDIR /data
VOLUME /data
ENTRYPOINT ["/init"]

4
docker/healthcheck.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
/package/admin/s6/command/s6-svstat /run/s6-rc/servicedirs/hbbr || exit 1
/package/admin/s6/command/s6-svstat /run/s6-rc/servicedirs/hbbs || exit 1

View File

@ -0,0 +1,3 @@
#!/command/execlineb -P
posix-cd /data
/usr/bin/hbbr

View File

@ -0,0 +1 @@
longrun

View File

@ -0,0 +1,3 @@
#!/command/execlineb -P
posix-cd /data
/usr/bin/hbbs -r $RELAY

View File

@ -0,0 +1 @@
longrun