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

Commit

Permalink
Stack images overhaul (#63)
Browse files Browse the repository at this point in the history
* Pick up master changes

* Move PHP stack to PHP 7.0

* Add contributing guide

* Add contributing guide

* Fix jdk and vertx

* Contribute guide

* Remove commented instructions
  • Loading branch information
Eugene Ivantsov authored Feb 2, 2017
1 parent c01d7a6 commit 94896d7
Show file tree
Hide file tree
Showing 36 changed files with 158 additions and 616 deletions.
29 changes: 29 additions & 0 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# PRs for new stacks

## Naming conventions for repositories

Folder names in `/recipes` are repository name. So, if you want your image to be eclipse/my-image, create `/recipes/my-image` directory with Dockerfile in it.

## Naming conventions for tags

By default all stack images have `:latest` tag. If your repo should have several tags, create a subdirectory in your repo directory, say, `/recipes/my-image/mytag` with a Dockerfile in it.

Your repo will be built as `eclipse/my-image:mytag`.

`:latest` tag will be added by default, if your repo directory does not have any sub-dirs.

## Base Images

We recommend that you inherit from `eclipse/stack-base:ubuntu` or `eclipse/stack-base:debian` in your images. These base images have all runtime dependencies for workspace agent and some helpful utilities.

## Entrypoint and CMD

We start sshd in the `ENTRYPOINT` and our CMD is `tail -f /dev/null`. If you inherit from `eclipse/stack-base` and do not need to launch any services as the container starts, there is no need to override ENTRYPOINT or CMD.

If you override CMD, make sure it is a non-terminating command, otherwise your container will be stopped juast after CMD is executed.

# Repositories to issue PRs

Once a PR is issued in `che-dockerfiles` repository, another PR has to be created - this time to add your stack to Stack Library in Eclipse Che. Such a PR is optional.

Just having your repo built in an Eclipse DockerHub account does not mean the stack will show up in Stack Library. Take a look [Stacks in Che](https://github.com/eclipse/che/blob/master/ide/che-core-ide-stacks/src/main/resources/stacks.json)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The `che` repository is where we do development and there are many ways you can

- [Submit bugs and feature requests](http://github.com/eclipse/che/issues) and help us verify them
- Review [source code changes](http://github.com/eclipse/che/pulls)
- [Review the docs](https://www.eclipse.org/che/docs/) and make improvements for anything from typos to new content
- [Review the docs](https://eclipse.org/che/docs/) and make improvements for anything from typos to new content

### Customizing
There are many ways to customize Che out-of-the-box including [stacks, templates, commands, IDE extensions, server-side extensions plugins, assemblies, RESTful APIs, and editors](https://github.com/eclipse/che/blob/master/CUSTOMIZING.md).
Expand Down
45 changes: 45 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
docker login -u riuvshin -p 80b1iXVCBomYVmyAmvV2
# if you want to push images, login as user with access to eclipse org hub.docker.com account
cd $(pwd)/recipes/stack-base/debian

docker build -t eclipse/stack-base:debian .
cd ../../..
cd $(pwd)/recipes/stack-base/ubuntu
docker build -t eclipse/stack-base:ubuntu .
cd ../../..
cd $(pwd)/recipes/debian_jdk8
docker build -t eclipse/debian_jdk8 .
cd ../..
cd $(pwd)/recipes/ubuntu_jdk8
docker build -t eclipse/ubuntu_jdk8 .
cd ../..
cd $(pwd)/recipes/ubuntu_python/2.7
docker build -t eclipse/ubuntu_python:2.7 .

cd ../..
dir=$(find . -maxdepth 3 -mindepth 1 -type d -not -path '*/\.*' -exec bash -c 'cd "$0" && pwd' {} \;)

for d in $dir
do
IMAGE=$(echo $d | sed 's/.*recipes\///' | awk -F'/' '{print $1}')
TAG=$(echo $d | sed 's/.*recipes\///' | awk -F'/' '{print $2}')
if [ -n "$TAG" ]; then
TAG=$TAG
else
TAG="latest"
fi
cd $d
if [ ! -f $d/Dockerfile ]; then
echo "No Dockerfile Found. Skipping..."

else
docker build -t eclipse/"$IMAGE":"$TAG" .
if [ "$?" != "0" ]; then
echo "Unable to build image: $IMAGE"
exit $?
else
echo "$IMAGE:$TAG successfully built"
docker push eclipse/"$IMAGE":"$TAG"
fi
fi
done
11 changes: 3 additions & 8 deletions recipes/alpine_jdk8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ ENV JAVA_VERSION_MAJOR=8 \

# do all in one step
RUN apk upgrade --update && \
apk add --update libstdc++ curl ca-certificates bash openssh sudo unzip openssl && \
echo http://dl-2.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories && \
apk add --update libstdc++ curl ca-certificates bash openssh sudo unzip openssl shadow && \
for pkg in glibc-${GLIBC_VERSION} glibc-bin-${GLIBC_VERSION} glibc-i18n-${GLIBC_VERSION}; do curl -sSL https://github.com/andyshinn/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/${pkg}.apk -o /tmp/${pkg}.apk; done && \
apk add --allow-untrusted /tmp/*.apk && \
rm -v /tmp/*.apk && \
Expand Down Expand Up @@ -86,14 +87,9 @@ RUN apk upgrade --update && \
rm "/tmp/"* && \
adduser -S user -h /home/user -s /bin/bash -G root -u 1000 && \
echo "%root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
PASS=$(openssl rand -base64 32) && \
echo -e "${PASS}\n${PASS}" | passwd user && \
usermod -p "*" user && \
chown -R user /home/user/

RUN mkdir /usr/che \
&& wget -qO /usr/che/che https://raw.githubusercontent.com/eclipse/che/master/che.sh \
&& chmod +x /usr/che/che

ENV DOCKER_HOST=tcp://192.168.65.1 \
M2_HOME=/usr/lib/apache-maven-$MAVEN_VERSION

Expand All @@ -109,4 +105,3 @@ CMD sudo /usr/bin/ssh-keygen -A && \
sudo /usr/sbin/sshd -D && \
sudo su - && \
tail -f /dev/null

102 changes: 0 additions & 102 deletions recipes/aspnet/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion recipes/centos_jdk8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN yum update -y && \
sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd && \
echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
useradd -u 1000 -G users,wheel -d /home/user --shell /bin/bash -m user && \
echo -e "codenvy2016\ncodenvy2016" | passwd user && \
usermod -p "*" user && \
sed -i 's/requiretty/!requiretty/g' /etc/sudoers

USER user
Expand Down
5 changes: 3 additions & 2 deletions recipes/centos_vertx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ RUN yum -y update && \
echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
sed -i 's/Defaults requiretty/#Defaults requiretty/g' /etc/sudoers && \
useradd -u 1000 -G users,wheel -d /home/user --shell /bin/bash -m user && \
echo -e "secret\nsecret" | passwd user
usermod -p "*" user

COPY install-vertx-dependencies.sh /tmp/

RUN chown user:user /tmp/install-vertx-dependencies.sh && \
chmod a+x /tmp/install-vertx-dependencies.sh
USER user

RUN scl enable rh-maven33 /tmp/install-vertx-dependencies.sh && \
Expand Down
Empty file modified recipes/centos_vertx/install-vertx-dependencies.sh
100755 → 100644
Empty file.
6 changes: 1 addition & 5 deletions recipes/cpp_gcc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@
# Contributors:
# Codenvy, S.A. - initial API and implementation

FROM eclipse/ubuntu_jre
FROM eclipse/stack-base:ubuntu
RUN sudo apt-get update && \
sudo apt-get install g++ gcc make gdb gdbserver -y && \
sudo apt-get clean && \
sudo apt-get -y autoremove && \
sudo rm -rf /var/lib/apt/lists/*

WORKDIR /projects

CMD tail -f /dev/null
29 changes: 2 additions & 27 deletions recipes/debian_jdk8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,17 @@
# Contributors:
# Codenvy, S.A. - initial API and implementation

FROM debian:jessie
FROM eclipse/stack-base:debian
EXPOSE 4403 8080 8000 22
RUN echo "deb http://ftp.debian.org/debian testing main" >> /etc/apt/sources.list && \
apt-get update && \
apt-get -y install locales openssh-server sudo procps wget unzip openjdk-8-jdk-headless mc git curl subversion nmap && \
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 && \
echo "secret\nsecret" | passwd user && apt-get -y autoremove \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/*

USER user

LABEL che:server:8080:ref=tomcat8 che:server:8080:protocol=http che:server:8000:ref=tomcat8-debug che:server:8000:protocol=http


ENV MAVEN_VERSION=3.3.9 \
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64 \
TOMCAT_HOME=/home/user/tomcat8

ENV M2_HOME=/home/user/apache-maven-$MAVEN_VERSION

ENV PATH=$JAVA_HOME/bin:$M2_HOME/bin:$PATH
ENV PATH=$M2_HOME/bin:$PATH

RUN mkdir /home/user/cbuild /home/user/tomcat8 /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/
Expand All @@ -39,14 +25,3 @@ ENV TERM xterm

RUN wget -qO- "http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.24/bin/apache-tomcat-8.0.24.tar.gz" | tar -zx --strip-components=1 -C /home/user/tomcat8 && \
rm -rf /home/user/tomcat8/webapps/*

ENV LANG C.UTF-8
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

WORKDIR /projects

CMD sudo /usr/sbin/sshd -D && \
tail -f /dev/null
5 changes: 0 additions & 5 deletions recipes/debian_jdk8_node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,3 @@ RUN sudo apt-get update && \
EXPOSE 3000 5000 9000
RUN sudo npm install -g npm@latest
RUN sudo npm install --unsafe-perm -g gulp bower grunt grunt-cli yeoman-generator yo generator-angular generator-karma generator-webapp

WORKDIR /projects

CMD sudo /usr/sbin/sshd -D && \
tail -f /dev/null
6 changes: 2 additions & 4 deletions recipes/dotnet_core/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
# Abel García Dorta <[email protected]>
# Roger S <[email protected]>

FROM eclipse/ubuntu_jre
FROM eclipse/stack-base:ubuntu

MAINTAINER [email protected]

RUN sudo apt-get update && \
sudo apt-get install apt-transport-https -y && \
echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" | sudo tee --append /etc/apt/sources.list.d/dotnetdev.list && \
echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" | sudo tee --append /etc/apt/sources.list.d/dotnetdev.list && \
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893 &&\
sudo apt-get update && \
sudo apt-get install dotnet-dev-1.0.0-preview2.1-003177 -y && \
Expand All @@ -30,5 +30,3 @@ RUN sudo npm install -g generator-aspnet
ENV LANG C.UTF-8
EXPOSE 5000
LABEL che:server:5000:ref=dot.net.server che:server:5000:protocol=http
WORKDIR /projects
CMD tail -f /dev/null
Loading

0 comments on commit 94896d7

Please sign in to comment.