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

Commit

Permalink
Update stack-base:debian.
Browse files Browse the repository at this point in the history
New `eclipse/stack-base:debian-stretch` and `eclipse/stack-base:debian`.
They are same.

New `eclipse/stack-base:debian-jessie` for the backward compatibility.

`php/5.6` uses `eclipse/stack-base:debian-jessie`.
  • Loading branch information
monaka committed Mar 1, 2019
1 parent b088277 commit e4d8547
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 14 deletions.
4 changes: 2 additions & 2 deletions recipes/php/5.6/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse/stack-base:debian
FROM eclipse/stack-base:debian-jessie
ENV DEBIAN_FRONTEND noninteractive
ENV CHE_MYSQL_PASSWORD=che
ENV CHE_MYSQL_DB=che_db
Expand Down Expand Up @@ -43,4 +43,4 @@ RUN sudo apt-get update && \
sudo service mysql restart && sudo mysql -u root --password="root" -e "CREATE USER '$CHE_MYSQL_USER'@'%' IDENTIFIED BY '"$CHE_MYSQL_PASSWORD"'" && \
sudo mysql -u root --password="root" -e "GRANT ALL PRIVILEGES ON *.* TO '$CHE_MYSQL_USER'@'%' IDENTIFIED BY '"$CHE_MYSQL_PASSWORD"'; FLUSH PRIVILEGES;" && \
sudo mysql -u root --password="root" -e "CREATE DATABASE $CHE_MYSQL_DB;"
EXPOSE 80
EXPOSE 80
1 change: 1 addition & 0 deletions recipes/stack-base/debian
57 changes: 57 additions & 0 deletions recipes/stack-base/debian-jessie/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Copyright (c) 2012-2016 Codenvy, S.A.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
# Contributors:
# Codenvy, S.A. - initial API and implementation

FROM debian:jessie-backports

ARG OPENJDK_VERSION=8u171-b11-1~bpo8+1

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 \
openssh-server \
sudo \
rsync \
procps \
-t jessie-backports \
openjdk-8-jdk-headless=$OPENJDK_VERSION \
openjdk-8-source=$OPENJDK_VERSION \
wget \
unzip \
mc \
locales \
ca-certificates \
curl \
bash-completion \
git \
subversion && \
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 && \
useradd -u 1000 -G users,sudo -d /home/user --shell /bin/bash -m user && \
usermod -p "*" user && \
apt-get clean && \
apt-get -y autoremove \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/* && \
echo "#! /bin/bash\n set -e\n sudo /usr/sbin/sshd -D &\n exec \"\$@\"" > /home/user/entrypoint.sh && chmod a+x /home/user/entrypoint.sh

COPY open-jdk-source-file-location /open-jdk-source-file-location
RUN sed -i -e "s/{{OPENJDK_VERSION}}/$OPENJDK_VERSION/g" /open-jdk-source-file-location

ENV LANG C.UTF-8
USER user
RUN sudo localedef -i en_US -f UTF-8 en_US.UTF-8 && \
svn --version && \
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
ENTRYPOINT ["/home/user/entrypoint.sh"]
CMD tail -f /dev/null
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ This package distributes OpenJDK binaries that are licensed under the GPL.
The source code and build scripts used to create this binary are available for download at:

OpenJDK Package installed via package manager: openjdk-8-jre-headless, openjdk-8-source
OpenJDK version: 8u171-b11-1~bpo8+1
OpenJDK sources: http://cdn-fastly.deb.debian.org/debian/pool/main/o/openjdk-8/openjdk-8_8u171-b11-1~bpo8+1.debian.tar.xz
OpenJDK version: {{OPENJDK_VERSION}}
OpenJDK sources: http://cdn-fastly.deb.debian.org/debian/pool/main/o/openjdk-8/openjdk-8_{{OPENJDK_VERSION}}.debian.tar.xz

The following license applies to OpenJDK

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@
# Contributors:
# Red Hat, Inc. - initial API and implementation

FROM debian:jessie
FROM debian:stretch
ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
ENV PATH $JAVA_HOME/bin:$PATH
RUN echo "deb http://http.debian.net/debian jessie-backports main" >> /etc/apt/sources.list && \
apt-get update && \
RUN apt-get update && \
apt-get -y install \
git \
subversion \
gnupg2 \
openssh-server \
sudo \
rsync \
procps \
-t jessie-backports \
openjdk-8-jdk-headless=8u171-b11-1~bpo8+1 \
openjdk-8-source=8u171-b11-1~bpo8+1 \
openjdk-8-jdk-headless \
openjdk-8-source \
wget \
unzip \
mc \
Expand All @@ -34,9 +35,6 @@ RUN echo "deb http://http.debian.net/debian jessie-backports main" >> /etc/apt/s
# 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 && \
sudo echo -e "deb http://ppa.launchpad.net/git-core/ppa/ubuntu precise main\ndeb-src http://ppa.launchpad.net/git-core/ppa/ubuntu precise main" >> /etc/apt/sources.list.d/sources.list && \
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A1715D88E1DF1F24 && \
sudo apt-get install git subversion -y && \
apt-get clean && \
apt-get -y autoremove \
&& apt-get -y clean \
Expand All @@ -48,7 +46,6 @@ RUN sudo localedef -i en_US -f UTF-8 en_US.UTF-8 && \
svn --version && \
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
40 changes: 40 additions & 0 deletions recipes/stack-base/debian-stretch/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 "$@"

0 comments on commit e4d8547

Please sign in to comment.