-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
74 lines (60 loc) · 2.04 KB
/
Dockerfile
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
66
67
68
69
70
71
72
73
74
# Use an official Ubuntu as the base image
FROM ubuntu:18.04
LABEL maintainer="Jegatheesan Kavienan <kavienanj@gmail.com>"
# Set non-interactive mode for apt-get to avoid prompts
ENV DEBIAN_FRONTEND=noninteractive
# Update package lists, upgrade installed packages, and install necessary packages
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
build-essential \
automake \
git \
libncurses5-dev \
texinfo \
qemu \
libvirt-bin \
perl \
cgdb \
dos2unix \
ctags \
cscope \
vim \
ca-certificates \
libx11-dev \
libxrandr-dev \
wget && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Reset DEBIAN_FRONTEND
ENV DEBIAN_FRONTEND=
# Copy the Pintos src directory to the image
COPY pintos/src /pintos/src
# Ensure that the script file has executable permissions
RUN chmod +x /pintos/src/misc/bochs-2.6.2-build.sh
RUN chmod +x /pintos/src/misc/toolchain-build.sh
# Ensure there are no hidden char. or incorrect line ending
RUN dos2unix /pintos/src/misc/bochs-2.6.2-build.sh
RUN dos2unix /pintos/src/misc/toolchain-build.sh
# Make toolchain directory
RUN mkdir -p /pintos/toolchain
# build Bochs from source
RUN pintos/src/misc/bochs-2.6.2-build.sh /pintos/toolchain/x86_64
# Build the toolchain with a custom prefix
RUN /pintos/src/misc/toolchain-build.sh --prefix /pintos/toolchain/x86_64 /pintos/toolchain && \
echo 'export PATH=/pintos/toolchain/x86_64/bin:$PATH' >> ~/.bashrc
# Set the environment variables
ENV PATH="/pintos/toolchain/x86_64/bin:${PATH}"
# Install Pintos utilities
RUN cd /pintos/src/utils && \
make && \
cp backtrace pintos Pintos.pm pintos-gdb pintos-set-cmdline pintos-mkdisk setitimer-helper squish-pty squish-unix /pintos/toolchain/x86_64/bin && \
mkdir -p /pintos/toolchain/x86_64/misc && \
cp ../misc/gdb-macros /pintos/toolchain/x86_64/misc
# Build Threads
RUN cd /pintos/src/threads && \
make
# Set the working directory
WORKDIR /pintos/src/threads
# Set the entrypoint
ENTRYPOINT ["/bin/bash"]