forked from superradcompany/microsandbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
65 lines (57 loc) · 2.33 KB
/
Copy pathDockerfile
File metadata and controls
65 lines (57 loc) · 2.33 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Use Debian 10 (Buster) as the base image.
# Debian 10 is known to ship with GLIBC 2.28, ensuring compatibility.
FROM debian:10
# Set environment variables to prevent interactive prompts during package installation.
ENV DEBIAN_FRONTEND=noninteractive
# Install Rust and Cargo non-interactively
# -s: Read commands from standard input
# --: Treat all subsequent arguments as non-options (for the script)
# -y: Disable confirmation prompt (answer "yes" to all questions)
# --no-modify-path: Do not modify the PATH environment variable in the shell's profile files.
# We'll set PATH explicitly in the Dockerfile.
RUN apt-get update && apt-get install -y curl
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV CARGO_HOME="/root/.cargo"
ENV PATH="$CARGO_HOME/bin:$PATH"
RUN find / -name rustc
RUN find / -name cargo
RUN rustc --version
RUN cargo --version
# Update the package list and install essential build tools.
# build-essential provides gcc, g++, make, libc-dev, etc.
# git is included for general development, though not strictly required if source is mounted.
# python3 and python3-pip are added for Python 3 and its package installer.
# patchelf, bc, libelf-dev, flex, bison, and curl are added as requested.
RUN apt-get install -y \
build-essential \
git \
python3 \
python3-pip \
patchelf \
bc \
libelf-dev \
flex \
bison \
curl \
clang \
libclang-dev \
pkg-config \
libssl-dev \
# Clean up apt caches to reduce image size
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN clang --version
# Install pyelftools using pip3.
# pyelftools is a Python library for analyzing ELF files, which might be relevant
# for projects dealing with executables and their structure.
RUN pip3 install pyelftools
# (Optional) Verify the GLIBC version within the container.
# This command will print the GLIBC version when the container starts or when run manually.
# It's commented out by default but useful for debugging.
# RUN ldd --version
# Set the working directory inside the container.
# The project source code will be mounted into this directory by GitHub Actions.
RUN mkdir /app && mkdir /app/build && mkdir /app/build/target && mkdir /app/build/release
WORKDIR /app
# The Docker image is now ready. The actual build commands will be run by GitHub Actions
# after mounting the source code.