-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile_17.1
More file actions
77 lines (66 loc) · 1.7 KB
/
Dockerfile_17.1
File metadata and controls
77 lines (66 loc) · 1.7 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
66
67
68
69
70
71
72
73
74
75
76
77
# Use Ubuntu 22.04 as the base image
FROM ubuntu:22.04
# Define build-time arguments for hostname and username
ARG HOSTNAME
ARG USERNAME
# Set the hostname dynamically based on the build argument
RUN echo "$HOSTNAME" > /etc/hostname
# Set non-interactive mode for apt
ENV DEBIAN_FRONTEND=noninteractive
# Update and install required dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bc \
bison \
build-essential \
curl \
flex \
g++-multilib \
gcc-multilib \
git \
git-lfs \
gnupg \
gperf \
imagemagick \
lib32readline-dev \
lib32z1-dev \
libelf-dev \
liblz4-tool \
lz4 \
libsdl1.2-dev \
libssl-dev \
libxml2 \
libxml2-utils \
lzop \
pngcrush \
rsync \
schedtool \
squashfs-tools \
unzip \
xsltproc \
zip \
zlib1g-dev \
lib32ncurses5-dev \
libncurses5 \
libncurses5-dev \
python-is-python3 \
python2.7 \
kmod \
openssl \
&& apt-get clean \
&& rm -rfv /var/lib/apt/lists/*
# Set up Python symlink for compatibility
RUN ln -sf /usr/bin/python3 /usr/bin/python
# Add a user to avoid running as root
RUN useradd -ms /bin/bash "$USERNAME"
# Set the USER environment variable
ENV USER="$USERNAME"
# Set up a working directory
WORKDIR "/home/$USERNAME"
RUN mkdir -p "/home/$USERNAME/android"
# Change ownership of the working directory to the new user
RUN chown -R $USERNAME:$USERNAME /home/$USERNAME
# Switch to the non-root user
USER "$USERNAME"
# Command to keep the container running
CMD ["bash"]