# Base image is Ubuntu Linux
FROM ubuntu:18.04

# Install tools and dependencies
RUN apt-get update && apt-get upgrade -y && apt-get install -y curl file vim python3 net-tools ssh zip openjdk-11-jre-headless

# get group id and group name from host machine
ARG GROUP_ID
ARG GROUP_NAME

# Copy installation files to the docker container
COPY moshell* /.mosh_inst/
WORKDIR /.mosh_inst

# Install Moshell (Full installation, default options)
RUN ["/bin/bash","moshell_install","-p","moshelldir=/opt,java=java,perl=/bin/perl"]

# Create a new user (with same username as host)
RUN addgroup --gid ${GROUP_ID} ${GROUP_NAME}
WORKDIR /
EXPOSE 25
EXPOSE 9002:9999
EXPOSE 10000:11000
EXPOSE 11881
