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

Commit

Permalink
Initial version of Quarkus.io image (#240)
Browse files Browse the repository at this point in the history
see tqvarnst/quarkus-workshop#2

Signed-off-by: Michael Vorburger <mike@vorburger.ch>
  • Loading branch information
vorburger authored and l0rd committed Apr 8, 2019
1 parent 85d1bf2 commit db3a6d4
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
14 changes: 14 additions & 0 deletions recipes/centos_quarkus.io_jdk8/.cccp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) 2019-2019 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

# This file is needed to include the project in the CentOS Container Pipeline
# main index. It can be used to set the image name (using job-id), set the test
# script and/or build script and whether to perform or skip the user-defined
# tests. More information on cccp.yml file can be found on:
# https://github.com/CentOS/container-index#the-cccpyml-file

job-id: centos-quarkus.io-jdk8
23 changes: 23 additions & 0 deletions recipes/centos_quarkus.io_jdk8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (c) 2019-2019 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 registry.centos.org/che-stacks/centos-jdk8

MAINTAINER Michael Vorburger <mike@vorburger.ch>

EXPOSE 8080
LABEL che:server:8080:ref=quarkus che:server:8080:protocol=http

COPY install_quarkus_dependencies.sh /tmp/
RUN sudo chown user:user /tmp/install_quarkus_dependencies.sh && \
sudo chmod a+x /tmp/install_quarkus_dependencies.sh && \
scl enable rh-maven33 /tmp/install_quarkus_dependencies.sh && \
sudo rm -f /tmp/install_quarkus_dependencies.sh && \
sudo chgrp -R 0 /home/user && \
sudo chmod -R g+rwX /home/user
21 changes: 21 additions & 0 deletions recipes/centos_quarkus.io_jdk8/install_quarkus_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
# Copyright (c) 2019-2019 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

set -ex

echo -e "${BLUE}Installing Quarkus.io dependencies..."
mkdir /tmp/install_quarkus_dependencies ; cd /tmp/install_quarkus_dependencies

git clone https://github.com/quarkusio/quarkus-quickstarts.git ; cd quarkus-quickstarts
# Make sure that this line closely matches the one in test.sh (which simulates what a Che end-user will do)
./mvnw -DskipTests -Ddocker.skip=true clean install dependency:go-offline dependency:resolve-plugins
# We skip tests just to speed up the build of this container, but to still make 'mvn test' work without downloads:
./mvnw org.apache.maven.plugins:maven-surefire-plugin:help

rm -Rf /tmp/install_quarkus_dependencies
echo -e "${BLUE}Quarkus.io dependencies installed ${NC}"
30 changes: 30 additions & 0 deletions recipes/centos_quarkus.io_jdk8/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
# Copyright (c) 2019-2019 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

set -ex

docker build -t che-stacks/centos-quarkus.io-jdk8-test .

echo "The following Maven build should be quick and not download any dependencies anymore..."
docker run --rm --name centos-quarkus.io-jdk8-test-run che-stacks/centos-quarkus.io-jdk8-test \
bash -c "\
git clone https://github.com/quarkusio/quarkus-quickstarts.git ; \
cd quarkus-quickstarts; \
./mvnw -DskipTests -Ddocker.skip=true clean install"
# Make sure that this ^^^ closely matches what a Che end-user will do,
# and keep the Maven arguments here in line with install_quarkus_dependencies.sh.
# (NB: skipTests is special just to make this run fast; see install_quarkus_dependencies.sh)


# For (manual) testing of quarkus:dev, to make sure it doesn't download anything additional (it does not), use:
#
# docker run --rm --name centos-quarkus.io-jdk8-test-run che-stacks/centos-quarkus.io-jdk8-test \
# bash -c "\
# git clone https://github.com/quarkusio/quarkus-quickstarts.git ; \
# cd quarkus-quickstarts/getting-started ; \
# ./mvnw compile quarkus:dev"

0 comments on commit db3a6d4

Please sign in to comment.