-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (35 loc) · 984 Bytes
/
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
# Copyright (c) 2024 RFull Development
# This source code is managed under the MIT license. See LICENSE in the project root.
FROM php:latest
# Install dependencies
RUN apt update && \
apt install -y sudo git gnupg2 vim curl lsb-release locales wget
# Install development tools for root
ARG USER_NAME=developer
ARG LOCALE=en_US.UTF-8
COPY ./shells/root/ ./shells/
RUN cd ./shells && \
chmod +x *.sh && \
./create_user.sh ${USER_NAME} && \
./setup_locale.sh ${LOCALE} && \
./install.sh && \
cd ..
RUN rm -rf ./shells
# Switch to the non-root user
USER ${USER_NAME}
WORKDIR /home/${USER_NAME}
# Install development tools for non-root
COPY --chown=${USER_NAME}:${USER_NAME} ./shells/user/ ./shells/
RUN cd ./shells && \
chmod +x *.sh && \
./install.sh && \
cd ..
RUN rm -rf ./shells
USER root
# Clean up
RUN apt clean && \
rm -rf /var/lib/apt/lists/*
RUN rm -rf /tmp/* && \
rm -rf /var/tmp/*
USER ${USER_NAME}
WORKDIR /home/${USER_NAME}