Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.

Ubuntu without JDK, additional latest Ubuntu LTS and JDK11 #232

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
6 changes: 0 additions & 6 deletions recipes/stack-base/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

FROM ubuntu:16.04

ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
ENV PATH=$JAVA_HOME/bin:$PATH
RUN apt-get update && \
apt-get -y install \
locales \
Expand All @@ -34,14 +32,11 @@ RUN apt-get update && \
useradd -u 1000 -G users,sudo,root -d /home/user --shell /bin/bash -m user && \
usermod -p "*" user && \
add-apt-repository ppa:git-core/ppa && \
add-apt-repository ppa:openjdk-r/ppa && \
apt-get update && \
sudo apt-get install git subversion -y && \
apt-get clean && \
apt-get -y autoremove && \
sudo apt-get install openjdk-8-jdk-headless=8u171-b11-0ubuntu0.16.04.1 openjdk-8-source=8u171-b11-0ubuntu0.16.04.1 -y && \
sudo update-ca-certificates -f && \
sudo sudo /var/lib/dpkg/info/ca-certificates-java.postinst configure && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*

Expand All @@ -53,7 +48,6 @@ RUN sudo locale-gen en_US.UTF-8 && \
cd /home/user && ls -la && \
sed -i 's/# store-passwords = no/store-passwords = yes/g' /home/user/.subversion/servers && \
sed -i 's/# store-plaintext-passwords = no/store-plaintext-passwords = yes/g' /home/user/.subversion/servers
COPY open-jdk-source-file-location /open-jdk-source-file-location
EXPOSE 22 4403
WORKDIR /projects

Expand Down
75 changes: 75 additions & 0 deletions recipes/stack-base/ubuntu_lts/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Copyright (c) 2012-2018 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation

FROM ubuntu:18.04

RUN apt-get update && \
apt-get -y install \
libcap2-bin \
locales \
rsync \
openssh-server \
sudo \
procps \
wget \
unzip \
mc \
ca-certificates \
curl \
software-properties-common \
bash-completion && \
mkdir /var/run/sshd && \
sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd && \
echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
# Adding user to the 'root' is a workaround for https://issues.jboss.org/browse/CDK-305
useradd -u 1000 -G users,sudo,root -d /home/user --shell /bin/bash -m user && \
usermod -p "*" user && \
add-apt-repository ppa:git-core/ppa && \
apt-get update && \
sudo apt-get install git subversion -y && \
apt-get clean && \
apt-get -y autoremove && \
sudo update-ca-certificates -f && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*

ENV LANG en_GB.UTF-8
ENV LANG en_US.UTF-8
USER user
RUN sudo locale-gen en_US.UTF-8 && \
svn --version && \
cd /home/user && ls -la && \
sed -i 's/# store-passwords = no/store-passwords = yes/g' /home/user/.subversion/servers && \
sed -i 's/# store-plaintext-passwords = no/store-plaintext-passwords = yes/g' /home/user/.subversion/servers
EXPOSE 22 4403
WORKDIR /projects

# The following instructions set the right
# permissions and scripts to allow the container
# to be run by an arbitrary user (i.e. a user
# that doesn't already exist in /etc/passwd)
ENV HOME /home/user
RUN for f in "/home/user" "/etc/passwd" "/etc/group" "/projects"; do\
sudo chgrp -R 0 ${f} && \
sudo chmod -R g+rwX ${f}; \
done && \
# Generate passwd.template \
cat /etc/passwd | \
sed s#user:x.*#user:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/bash#g \
> /home/user/passwd.template && \
# Generate group.template \
cat /etc/group | \
sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g \
> /home/user/group.template && \
sudo sed -ri 's/StrictModes yes/StrictModes no/g' /etc/ssh/sshd_config
COPY --chown=user entrypoint.sh /home/user/entrypoint.sh
RUN chmod +x /home/user/entrypoint.sh
ENTRYPOINT ["/home/user/entrypoint.sh"]
CMD tail -f /dev/null
40 changes: 40 additions & 0 deletions recipes/stack-base/ubuntu_lts/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
# Copyright (c) 2012-2018 Red Hat, Inc.
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which is available at http://www.eclipse.org/legal/epl-2.0.html
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation

set -e

export USER_ID=$(id -u)
export GROUP_ID=$(id -g)

if ! grep -Fq "${USER_ID}" /etc/passwd; then
# current user is an arbitrary
# user (its uid is not in the
# container /etc/passwd). Let's fix that
cat ${HOME}/passwd.template | \
sed "s/\${USER_ID}/${USER_ID}/g" | \
sed "s/\${GROUP_ID}/${GROUP_ID}/g" | \
sed "s/\${HOME}/\/home\/user/g" > /etc/passwd

cat ${HOME}/group.template | \
sed "s/\${USER_ID}/${USER_ID}/g" | \
sed "s/\${GROUP_ID}/${GROUP_ID}/g" | \
sed "s/\${HOME}/\/home\/user/g" > /etc/group
fi

if test "${USER_ID}" = 0; then
# current user is root
/usr/sbin/sshd -D &
elif sudo -n true > /dev/null 2>&1; then
# current user is a suoder
sudo /usr/sbin/sshd -D &
fi

exec "$@"
25 changes: 25 additions & 0 deletions recipes/ubuntu_jdk11/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM eclipse/stack-base:ubuntu_lts
EXPOSE 4403 8000 8080 9876 22

LABEL che:server:8080:ref=tomcat9 che:server:8080:protocol=http che:server:8000:ref=tomcat9-debug che:server:8000:protocol=http che:server:9876:ref=codeserver che:server:9876:protocol=http

ENV MAVEN_VERSION=3.6.0 \
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 \
TOMCAT_HOME=/home/user/tomcat9 \
TERM=xterm
ENV M2_HOME=/home/user/apache-maven-$MAVEN_VERSION
ENV PATH=$JAVA_HOME/bin:$M2_HOME/bin:$PATH

COPY open-jdk-source-file-location /open-jdk-source-file-location

RUN sudo apt-get update && \
sudo apt-get install openjdk-11-jdk-headless=10.0.2+13-1ubuntu0.18.04.4 openjdk-11-source=10.0.2+13-1ubuntu0.18.04.4 -y && \
sudo sudo /var/lib/dpkg/info/ca-certificates-java.postinst configure && \
mkdir /home/user/tomcat9 /home/user/apache-maven-$MAVEN_VERSION && \
wget -qO- "http://apache.ip-connect.vn.ua/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz" | tar -zx --strip-components=1 -C /home/user/apache-maven-$MAVEN_VERSION/ && \
wget -qO- "http://archive.apache.org/dist/tomcat/tomcat-9/v9.0.14/bin/apache-tomcat-9.0.14.tar.gz" | tar -zx --strip-components=1 -C /home/user/tomcat9 && \
rm -rf /home/user/tomcat9/webapps/* && \
sudo mkdir -p /home/user/.m2 && \
sudo mkdir -p /home/user/jdtls/data && \
sudo chgrp -R 0 ${HOME} && \
sudo chmod -R g+rwX ${HOME}
Loading