Skip to content
Dockerfile 1.31 KiB
Newer Older
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 /
RUN chmod 755 /base_entrypoint.sh
ENTRYPOINT ["/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