Files
debian-vnc-xfce-g3/examples/Dockerfile.extend
2024-03-29 03:26:57 -05:00

57 lines
1.9 KiB
Docker
Executable File

# docker build -f Dockerfile.extend -t accetto/debian-vnc-xfce-g3:extended .
### This is an example of extending the images.
### HINTS
### Sometimes you can get building errors related to cache handling.
### One of the following usually helps:
### (1) Use the '--no-cache' option
### > docker build ... --no-cache
### (2) Purge the builder cache before and/or between builds
### > docker builder prune
### (3) Re-open the terminal and/or Visual Studio Code
### (4) Remove the line containing 'rm -rf /var/lib/apt/lists/*'
### from your extending Dockerfile (like this one)
### choose a base image and tag
ARG BASEIMAGE="accetto/debian-vnc-xfce-g3"
# ARG BASEIMAGE="accetto/debian-vnc-xfce-chromium-g3"
# ARG BASEIMAGE="accetto/debian-vnc-xfce-firefox-g3"
ARG BASETAG="latest"
FROM ${BASEIMAGE}:${BASETAG}
### switch to the root user to be able to install new packages
USER 0
### update the apt cache and install your new packages
### e.g. vim editor
RUN \
apt-get update \
&& apt-get install -y --no-install-recommends \
vim \
&& apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/*
### maybe you want to add some additional resources
### e.g. some preconfigured files
# COPY ./bashrc "${HOME}"/.bashrc
# COPY ./firefox.plus/user.js "${HOME}"/firefox.plus/
### avoid the pitfall of failing startup under some circumstances
### permissions will be set to the system defaults on the first container start
RUN chmod 666 /etc/passwd /etc/group
### usually you want to swich back to a non-root user
### alternatively you can do it in a compose file (see 'example.yml')
USER "${HEADLESS_USER_ID}"
### note that some applications refuse to be installed under the root user
### those you have to install after switching the user
# RUN \
# apt-get update \
# && apt-get install -y \
# <app-package-name-comes-here> \
# && apt-get -y autoremove \
# && rm -rf /var/lib/apt/lists/*