-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrust.Dockerfile
More file actions
40 lines (32 loc) · 1.05 KB
/
rust.Dockerfile
File metadata and controls
40 lines (32 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# syntax=docker/dockerfile:1
ARG RUST_VERSION=1.81.0
ARG APP_NAME=rem_math_sandbox
ARG APP_WORKDIR=/rem_math_sandbox
FROM rust:${RUST_VERSION}-slim-bullseye AS build
ARG APP_NAME
ARG APP_WORKDIR
WORKDIR ${APP_WORKDIR}
# ssl lib のインストール
RUN apt-get update -y && \
apt-get install -y pkg-config make g++ libssl-dev && \
rustup target add x86_64-unknown-linux-gnu
# OpenCLのライブラリインストールをします
RUN apt update
RUN apt install ocl-icd-opencl-dev -y
RUN --mount=type=bind,source=src,target=src \
--mount=type=bind,source=Cargo.toml,target=Cargo.toml \
--mount=type=bind,source=Cargo.lock,target=Cargo.lock \
--mount=type=cache,target=/$APP_WORKDIR/target/ \
--mount=type=cache,target=/usr/local/cargo/registry/ \
RUSTFLAGS="-Z threads=8" cargo +nightly build --release --locked
ARG UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
appuser
USER appuser
ENTRYPOINT ["/bin/bash", "-c"]