Skip to content

Commit

Permalink
CHE-2977 "move the core Che Dockerfiles and Dockerfile.centos into /d…
Browse files Browse the repository at this point in the history
…ockerfiles/che (eclipse-che#3318)

* CHE-2977 "move the core Che Dockerfiles and Dockerfile.centos into /dockerfiles/che"

merge docker.sh and che.sh.
also docker.sh script is moved from the assembly folder to the docker image folder and named entrypoint.sh

Change-Id: I7404f8f2896e8a7eea83ecab57a6c4c623c68abe
Signed-off-by: Florent BENOIT <fbenoit@codenvy.com>
  • Loading branch information
benoitf committed Dec 12, 2016
1 parent 3fbed85 commit f01ab2b
Show file tree
Hide file tree
Showing 8 changed files with 395 additions and 296 deletions.
4 changes: 0 additions & 4 deletions .dockerignore

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -62,3 +62,4 @@ Thumbs.db

# Che files
.che
dockerfiles/che/eclipse-che.tar.gz
6 changes: 0 additions & 6 deletions assembly/assembly-main/src/assembly/assembly.xml
Expand Up @@ -192,12 +192,6 @@
</fileSet>
</fileSets>
<files>
<file>
<source>${project.basedir}/src/assembly/bin/docker.sh</source>
<outputDirectory>bin</outputDirectory>
<destName>docker.sh</destName>
<fileMode>755</fileMode>
</file>
<file>
<source>${project.basedir}/src/assembly/bin/che.sh</source>
<outputDirectory>bin</outputDirectory>
Expand Down
270 changes: 0 additions & 270 deletions assembly/assembly-main/src/assembly/bin/docker.sh

This file was deleted.

7 changes: 4 additions & 3 deletions Dockerfile → dockerfiles/che/Dockerfile
Expand Up @@ -9,7 +9,7 @@
# Codenvy S.A
#
# To build it, run in the repository root:
# `docker build -t codenvy/che-server .`
# `docker build -t eclipse/che-server .`
#
# To run it:
# docker run --net=host \
Expand Down Expand Up @@ -38,5 +38,6 @@ RUN echo "http://dl-4.alpinelinux.org/alpine/edge/community" >> /etc/apk/reposit
rm -rf /tmp/* /var/cache/apk/*

EXPOSE 8000 8080
ADD assembly/assembly-main/target/eclipse-che-*/eclipse-che-* /home/user/che/
ENTRYPOINT ["/home/user/che/bin/docker.sh"]
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
ADD eclipse-che.tar.gz /home/user/
18 changes: 5 additions & 13 deletions Dockerfile.centos → dockerfiles/che/Dockerfile.centos
Expand Up @@ -8,7 +8,7 @@
# Dharmit Shah - Initial implementation
# Mario Loriedo - Improvements
#
# To build it, run in the repository root:
# To build it, run in the current folder after executing build.sh:
# `docker build -t registry.centos.org/eclipse/che-server -f Dockerfile.centos .`
#
# To run it:
Expand All @@ -34,20 +34,12 @@ RUN yum -y update && \
curl -sSL "https://${DOCKER_BUCKET}/builds/Linux/x86_64/docker-${DOCKER_VERSION}" -o /usr/bin/docker && \
chmod +x /usr/bin/docker && \
yum -y remove openssl && \
yum clean all
RUN useradd user -d /home/user -s /bin/bash -u 1000 -G root && \
groupadd docker -g 101 && \
usermod -aG ftp,users,docker user && \
yum clean all && \
echo "%root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
sed -i 's/Defaults requiretty/#Defaults requiretty/g' /etc/sudoers && \
rm -rf /tmp/* /var/cache/yum

EXPOSE 8000 8080

USER user

ADD assembly/assembly-main/target/eclipse-che-*/eclipse-che-* /home/user/che/

ENTRYPOINT [ "/home/user/che/bin/che.sh", "-c" ]

CMD [ "run" ]
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
ADD eclipse-che.tar.gz /home/user/
30 changes: 30 additions & 0 deletions dockerfiles/che/build.sh
@@ -0,0 +1,30 @@
#!/bin/sh
# Copyright (c) 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

IMAGE_NAME="eclipse/che-server"
source $(cd "$(dirname "$0")"; pwd)/../build.include

# grab assembly
DIR=$(cd "$(dirname "$0")"; pwd)
if [ ! -d "${DIR}/../../assembly/assembly-main/target" ]; then
echo "${ERRO}Have you built assembly/assemby-main in ${DIR}/../assembly/assembly-main 'mvn clean install'?"
exit 2
fi

# Use of folder
BUILD_ASSEMBLY_ZIP=$(echo ${DIR}/../../assembly/assembly-main/target/eclipse-che-*.tar.gz)
LOCAL_ASSEMBLY_ZIP=${DIR}/eclipse-che.tar.gz

if [ -f "${LOCAL_ASSEMBLY_ZIP}" ]; then
rm ${LOCAL_ASSEMBLY_ZIP}
fi

echo "Linking assembly ${BUILD_ASSEMBLY_ZIP} --> ${LOCAL_ASSEMBLY_ZIP}"
ln ${BUILD_ASSEMBLY_ZIP} ${LOCAL_ASSEMBLY_ZIP}

init
build

0 comments on commit f01ab2b

Please sign in to comment.