1# NOTE: For now, don't be tempted to bump this to bullseye-slim, as Oxygen
2# still uses a glibc based on Debian 10, not Debian 11
3FROM debian:buster-slim AS docker_vmm
4
5ENV container docker
6ENV LC_ALL C.UTF-8
7ENV DEBIAN_FRONTEND noninteractive
8
9SHELL [ "/bin/bash", "-c" ]
10
11# Set up the user to be the same as the user creating the container.  Not
12# strictly necessary, but this way all the permissions of the generated files
13# will match.
14
15ARG USER
16ARG UID
17
18ENV USER $USER
19ENV HOME /home/$USER
20ENV CUSTOM_MANIFEST ""
21
22RUN apt update \
23    && apt install -y sudo
24
25RUN useradd -m -s /bin/bash $USER -u $UID -d $HOME \
26    && passwd -d $USER \
27    && echo "$USER ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
28
29RUN mkdir /source && chown -R $USER /source
30RUN mkdir /output && chown -R $USER /output
31RUN mkdir /working && chown -R $USER /working
32RUN mkdir /static && chown -R $USER /static
33
34USER $USER
35WORKDIR $HOME
36
37COPY --chown=$USER manifest.xml /static/manifest.xml
38COPY --chown=$USER custom.xml /static/custom.xml
39COPY --chown=$USER rebuild-internal.sh /static/rebuild-internal.sh
40
41RUN TOOLS_DIR=/static/tools /static/rebuild-internal.sh install_packages
42
43VOLUME /source
44VOLUME /working
45VOLUME /output
46
47FROM docker_vmm AS docker_vmm_persistent
48
49ENV container docker
50ENV LC_ALL C.UTF-8
51ENV DEBIAN_FRONTEND noninteractive
52
53SHELL [ "/bin/bash", "-c" ]
54
55USER root
56
57CMD ["sleep", "1d"]
58