File: Dockerfile.test

package info (click to toggle)
rust-path-facts 0.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 244 kB
  • sloc: makefile: 2
file content (24 lines) | stat: -rw-r--r-- 627 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Use the same Ubuntu version as GitHub Actions
FROM ubuntu:22.04

# Install Rust and required dependencies
RUN apt-get update && apt-get install -y \
    curl \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

# Create a non-root user (similar to GitHub Actions)
RUN useradd -m -s /bin/bash runner
USER runner
WORKDIR /home/runner/workspace

# Install Rust as the non-root user
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/home/runner/.cargo/bin:${PATH}"

# Copy project files
COPY --chown=runner:runner . .

# Build and run tests
CMD ["cargo", "test", "--", "--nocapture"]