-
Notifications
You must be signed in to change notification settings - Fork 46
/
Dockerfile
91 lines (66 loc) · 2.01 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Use the official Ubuntu 22.04 as the base image
FROM ubuntu:22.04
# Set environment variables to avoid interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
# Install necessary dependencies
RUN apt-get update && \
apt-get install -y \
git \
cmake \
ninja-build \
pkg-config \
ccache \
clang \
llvm \
lld \
binfmt-support \
libsdl2-dev \
libepoxy-dev \
libssl-dev \
python-setuptools \
g++-x86-64-linux-gnu \
nasm \
python3-clang \
libstdc++-10-dev-i386-cross \
libstdc++-10-dev-amd64-cross \
libstdc++-10-dev-arm64-cross \
squashfs-tools \
squashfuse \
libc-bin \
expect \
curl \
sudo \
fuse
# Create a new user and set their home directory
RUN useradd -m -s /bin/bash fex
RUN usermod -aG sudo fex
RUN echo "fex ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/fex
USER fex
WORKDIR /home/fex
# Clone the FEX repository and build it
RUN git clone --recurse-submodules https://github.com/FEX-Emu/FEX.git && \
cd FEX && \
mkdir Build && \
cd Build && \
CC=clang CXX=clang++ cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DUSE_LINKER=lld -DENABLE_LTO=True -DBUILD_TESTS=False -DENABLE_ASSERTIONS=False -G Ninja .. && \
ninja
WORKDIR /home/fex/FEX/Build
RUN sudo ninja install && \
sudo ninja binfmt_misc_32 && \
sudo ninja binfmt_misc_64
RUN sudo useradd -m -s /bin/bash steam
RUN sudo apt install wget
USER root
RUN echo 'root:steamcmd' | chpasswd
USER steam
WORKDIR /home/steam/.fex-emu/RootFS/
# Set up rootfs
RUN wget -O Ubuntu_22_04.tar.gz https://www.dropbox.com/scl/fi/16mhn3jrwvzapdw50gt20/Ubuntu_22_04.tar.gz?rlkey=4m256iahwtcijkpzcv8abn7nf
RUN tar xzf Ubuntu_22_04.tar.gz
RUN rm ./Ubuntu_22_04.tar.gz
WORKDIR /home/steam/.fex-emu
RUN echo '{"Config":{"RootFS":"Ubuntu_22_04"}}' > ./Config.json
WORKDIR /home/steam/Steam
# Download and run SteamCMD
RUN curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
ENTRYPOINT FEXBash ./steamcmd.sh