Repository navigation
Expand file tree
/
Copy pathextras.dockerfile
More file actions
62 lines (52 loc) · 2.17 KB
/
Copy pathextras.dockerfile
File metadata and controls
62 lines (52 loc) · 2.17 KB
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
######################################
### Permanent changes to container ###
######################################
# To make permanent changes to the container environment,
# you can edit this file, which uses the Dockerfile format.
# To add software, use the existing 'apt-get' block at the
# bottom of this file
###################################
# Boilerplate
ARG USER_BASE_IMG
FROM $USER_BASE_IMG
ARG UID
ARG USER
RUN rm -rf /var/lib/apt/lists/* \
&& dpkg --clear-avail \
&& apt-get update -q \
&& apt-get install -y --no-install-recommends \
sudo \
&& apt-get clean autoclean \
&& apt-get autoremove --yes \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/ \
&& useradd -u ${UID} -G sudo ${USER} \
&& passwd -d ${USER} \
# Always present the warning when using sudo
&& echo 'Defaults lecture_file = /etc/sudoers.lecture' >> /etc/sudoers \
&& echo 'Defaults lecture = always' >> /etc/sudoers \
&& echo 'Defaults timestamp_timeout=0' >> /etc/sudoers \
&& echo '##################### Warning! #####################################' > /etc/sudoers.lecture \
&& echo 'This is an ephemeral container! You can do things to it using sudo, ' >> /etc/sudoers.lecture \
&& echo 'but when you exit, changes made outside of your home directory will ' >> /etc/sudoers.lecture \
&& echo 'be lost.' >> /etc/sudoers.lecture \
&& echo 'If you want your changes to be permanent, add them to the ' >> /etc/sudoers.lecture \
&& echo ' /etc/imagesh/extras.dockerfile' >> /etc/sudoers.lecture \
&& echo '####################################################################' >> /etc/sudoers.lecture \
&& echo '' >> /etc/sudoers.lecture
# Boilerplate
###################################
###################################
# apt-get block
RUN dpkg --clear-avail \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get update -q \
&& apt-get install -y --no-install-recommends \
# Add more dependencies here
cowsay \
ssh \
vim \
&& apt-get clean autoclean \
&& apt-get autoremove --yes \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/
# apt-get block
###################################