-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (37 loc) · 1.17 KB
/
Dockerfile
File metadata and controls
48 lines (37 loc) · 1.17 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
41
42
43
44
45
46
47
48
### Test Image specific config
FROM rustlang/rust:nightly-alpine
# Install required packages
RUN apk add --no-cache \
bash \
coreutils \
findutils \
gawk \
grep \
sed \
parallel \
pkgconfig \
openssl-dev \
build-base \
moreutils
WORKDIR /app
# Copy project structure
COPY tests tests
COPY tests_utility tests_utility
COPY solutions solutions
# Use sparse index for Cargo (faster network)
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
# Pre-fetch all dependencies
RUN find tests -name Cargo.toml | parallel cargo fetch --manifest-path {}
# Fix permissions for Rust crates (avoid “permission denied”)
RUN find /usr/local/cargo/registry/src -type f -name '*.rs' -exec chmod 644 {} \;
# Remove solutions (only student code will be mounted)
RUN rm -rf solutions
### Metadata labels
LABEL org.opencontainers.image.source="https://github.com/01-edu/rust-tests"
LABEL org.opencontainers.image.description="01 Edu - Rust Test Image (Alpine)"
LABEL org.opencontainers.image.licenses="MIT"
# Copy entrypoint and isolate script
COPY entrypoint.sh ./
COPY isolate.sh ./
RUN chmod +x ./entrypoint.sh ./isolate.sh
ENTRYPOINT ["/app/entrypoint.sh"]