forked from mviereck/dockerfile-x11docker-mate
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
134 lines (117 loc) · 5.19 KB
/
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
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# x11docker with Ubuntu MATE
#
# Run Ubuntu MATE desktop in docker.
# Use x11docker to run image.
# Get x11docker from github:
# https://github.com/mviereck/x11docker
#
# Examples: docker build . -t ubuntu-mate
# x11docker --desktop ubuntu-mate
# x11docker ubuntu-mate caja
#
# Options:
# Persistent home folder stored on host with --home
# Shared host file or folder with --share PATH
# Hardware acceleration with option --gpu
# Clipboard sharing with option --clipboard
# ALSA sound support with option --alsa
# Pulseaudio sound support with option --pulseaudio
# Language setting with --lang [=$LANG]
# Printing over CUPS with --printer
# Webcam support with --webcam
#
# See x11docker --help for further options.
#
#
# Notes:
# 1. Ubuntu 12.04 LTS (precise), 14.04 LTS (trusty), 16.04 LTS (xenial) can operate without systemd
# 2. Ubuntu 18.04 LTS (bionic), 20.04 LTS (focal), 20.10 (groovy), 21.04 (hirsute), 21.10 (impish) and upcoming 22.04 LTS (jammy) are fully-functional while using systemd.
ARG VER=focal
FROM ubuntu:$VER
ENV SHELL=/bin/bash
RUN bash -c 'if test -n "$http_proxy"; then echo "Acquire::http::proxy \"$http_proxy\";" > /etc/apt/apt.conf.d/99proxy; else echo "Using direct network connection."; fi'
RUN apt-get update && \
env DEBIAN_FRONTEND=noninteractive apt-get install -y \
dbus-x11 \
procps \
psmisc && \
env DEBIAN_FRONTEND=noninteractive apt-get install -y \
xdg-utils \
xdg-user-dirs \
menu-xdg \
mime-support \
desktop-file-utils \
bash-completion && \
env DEBIAN_FRONTEND=noninteractive apt-get install -y \
mesa-utils-extra \
libxv1 \
sudo \
lsb-release
# Language/locale settings
# replace en_US by your desired locale setting,
# for example de_DE for german.
ENV LANG en_US.UTF-8
RUN echo $LANG UTF-8 > /etc/locale.gen && \
env DEBIAN_FRONTEND=noninteractive apt-get install -y \
locales && \
lsb_release -cs | grep -qE "precise|trusty" && locale-gen $LANG || update-locale --reset LANG=$LANG
RUN if lsb_release -cs | grep -qE "precise|xenial"; then \
echo "Notice: it is precise or xenial, need workaround for resolvconf." && \
echo "resolvconf resolvconf/linkify-resolvconf boolean false" | debconf-set-selections; \
else true; fi
RUN if lsb_release -cs | grep -q "precise"; then \
echo "Notice: it is precise, need workarounds and PPAs." && \
env DEBIAN_FRONTEND=noninteractive apt-get install -y python-software-properties && \
env DEBIAN_FRONTEND=noninteractive apt-add-repository -y ppa:ubuntu-mate-dev/ppa && \
env DEBIAN_FRONTEND=noninteractive apt-add-repository -y ppa:ubuntu-mate-dev/precise-mate && \
env DEBIAN_FRONTEND=noninteractive apt-get update && \
env DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
env DEBIAN_FRONTEND=noninteractive apt-get install -y ubuntu-mate-core --force-yes; \
else true; fi
RUN if lsb_release -cs | grep -q "trusty"; then \
echo "Notice: it is trusty, need workarounds and PPAs." && \
env DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common && \
env DEBIAN_FRONTEND=noninteractive apt-add-repository -y ppa:ubuntu-mate-dev/ppa && \
env DEBIAN_FRONTEND=noninteractive apt-add-repository -y ppa:ubuntu-mate-dev/trusty-mate && \
env DEBIAN_FRONTEND=noninteractive apt-get update && \
env DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --force-yes && \
env DEBIAN_FRONTEND=noninteractive apt-get install -y ubuntu-mate-core --force-yes; \
else true; fi
# Ubuntu MATE desktop
# * package for 12.04 LTS and 14.04 LTS
# * task for 16.04 LTS and newer versions
RUN if lsb_release -cs | grep -qE "precise|trusty"; then \
env DEBIAN_FRONTEND=noninteractive apt-get install -y \
ubuntu-mate-desktop --force-yes; \
else \
env DEBIAN_FRONTEND=noninteractive apt-get install -y \
ubuntu-mate-desktop^; \
fi
# 20.10 specifics
RUN if lsb_release -cs | grep -q "groovy"; then \
echo "Warning: it is groovy, will use workarounds!" && \
env DEBIAN_FRONTEND=noninteractive sudo apt autopurge -y \
acpid acpi-support sssd-common; \
else true; fi
# 21.04 specifics
RUN if lsb_release -cs | grep -q "hirsute"; then \
echo "Warning: it is hirsute, will use workarounds!" && \
env DEBIAN_FRONTEND=noninteractive sudo apt autopurge -y \
acpid acpi-support redshift-gtk; \
else true; fi
# 21.10 specifics
RUN if lsb_release -cs | grep -qE "impish"; then \
echo "Warning: it is impish, will use workarounds!" && \
env DEBIAN_FRONTEND=noninteractive sudo apt autopurge -y \
acpid acpi-support redshift-gtk; \
else true; fi
# 22.04 LTS specifics
RUN if lsb_release -cs | grep -qE "jammy"; then \
echo "Warning: it is jammy, will use workarounds!" && \
env DEBIAN_FRONTEND=noninteractive sudo apt autopurge -y \
acpid acpi-support; \
else true; fi
# remove mate-screensaver
RUN env DEBIAN_FRONTEND=noninteractive apt-get purge mate-screensaver -y
RUN env DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y
CMD ["mate-session"]