Newer
Older
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
FROM ubuntu:18.04
MAINTAINER Stefano Alberto Russo <stefano.russo@inaf.it>
#----------------------
# Basics
#----------------------
# Set non-interactive
ENV DEBIAN_FRONTEND noninteractive
# Update first of all
RUN apt-get update
# Utilities
RUN apt-get install -y nano telnet unzip wget supervisor build-essential python-dev git-core openjdk-8-jre
#------------------------
# "Meta" user
#------------------------
# Add group. We chose GID 65527 to try avoiding conflicts.
RUN groupadd -g 65527 metauser
# Add user. We chose UID 65527 to try avoiding conflicts.
RUN useradd metauser -d /home/metauser -u 65527 -g 65527 -m -s /bin/bash
# Add metuaser user to sudoers
RUN adduser metauser sudo
# Install suodo
RUN apt-get install sudo -y
# No pass sudo (for everyone, actually)
COPY files/sudoers /etc/sudoers
# Prepare for user-space logs
RUN mkdir /home/metauser/.logs && chown metauser:metauser /home/metauser/.logs
# Rename metauser home folder as a "vanilla" home folder
RUN mv /home/metauser /metauser_home_vanilla
# Set container name
ENV CONTAINER_NAME='base'
# Entrypoint
COPY files/base_entrypoint.sh /usr/bin/base_entrypoint.sh
RUN chmod 755 /usr/bin/base_entrypoint.sh
ENTRYPOINT ["/usr/bin/base_entrypoint.sh"]
ENV DEFAULT_ENTRYPOINT_COMMAND="/bin/bash"
# Allow to move the /home_vanilla folder in /home
RUN chmod 777 /home
# Set user
USER metauser