aboutsummaryrefslogtreecommitdiff
path: root/src/desktop-lite
diff options
context:
space:
mode:
Diffstat (limited to 'src/desktop-lite')
-rw-r--r--src/desktop-lite/devcontainer-feature.json2
-rwxr-xr-xsrc/desktop-lite/install.sh18
2 files changed, 13 insertions, 7 deletions
diff --git a/src/desktop-lite/devcontainer-feature.json b/src/desktop-lite/devcontainer-feature.json
index a6382a0..7b2a5c2 100644
--- a/src/desktop-lite/devcontainer-feature.json
+++ b/src/desktop-lite/devcontainer-feature.json
@@ -1,6 +1,6 @@
{
"id": "desktop-lite",
- "version": "1.0.3",
+ "version": "1.0.4",
"name": "Light-weight Desktop",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/desktop-lite",
"description": "Adds a lightweight Fluxbox based desktop to the container that can be accessed using a VNC viewer or the web. GUI-based commands executed from the built-in VS code terminal will open on the desktop automatically.",
diff --git a/src/desktop-lite/install.sh b/src/desktop-lite/install.sh
index b05896c..dc8ee39 100755
--- a/src/desktop-lite/install.sh
+++ b/src/desktop-lite/install.sh
@@ -63,6 +63,9 @@ package_list_additional="
set -e
+# Clean up
+rm -rf /var/lib/apt/lists/*
+
if [ "$(id -u)" -ne 0 ]; then
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
exit 1
@@ -151,8 +154,10 @@ copy_fluxbox_config() {
apt_get_update()
{
- echo "Running apt-get update..."
- apt-get update -y
+ if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
+ echo "Running apt-get update..."
+ apt-get update -y
+ fi
}
# Checks if packages are installed and installs them if not
@@ -176,7 +181,7 @@ apt_get_update
if [[ -z $(apt-cache --names-only search ^tilix$) ]]; then
. /etc/os-release
if [ "${ID}" = "ubuntu" ]; then
- apt-get install -y --no-install-recommends apt-transport-https software-properties-common
+ check_packages apt-transport-https software-properties-common
add-apt-repository -y ppa:webupd8team/terminix
elif [ "${VERSION_CODENAME}" = "stretch" ]; then
echo "deb http://deb.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/stretch-backports.list
@@ -232,9 +237,7 @@ if [ "${INSTALL_NOVNC}" = "true" ] && [ ! -d "/usr/local/novnc" ]; then
rm -f /tmp/websockify-install.zip /tmp/novnc-install.zip
# Install noVNC dependencies and use them.
- if ! dpkg -s python3-minimal python3-numpy > /dev/null 2>&1; then
- apt-get -y install --no-install-recommends python3-minimal python3-numpy
- fi
+ check_packages python3-minimal python3-numpy
sed -i -E 's/^python /python3 /' /usr/local/novnc/websockify-${WEBSOCKETIFY_VERSION}/run
fi
@@ -387,6 +390,9 @@ if [ "${USERNAME}" != "root" ]; then
chown -R ${USERNAME} /home/${USERNAME}/.Xmodmap /home/${USERNAME}/.fluxbox
fi
+# Clean up
+rm -rf /var/lib/apt/lists/*
+
cat << EOF