diff --git a/CHANGELOG.md b/CHANGELOG.md index e8cf1b62fe..15c3ebe995 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ Usage: * Fix #88: Unreachable statement in DockerAssemblyManager * Fix #122: Bug 561261 - jkube-kit - insecure yaml load leading to RCE (CWE-502) * Fix #152: kubernetes namespace is ignored in debug goal +* Fix #163: Added Quickstart for external Dockerfile ### 0.2.0 (2020-03-05) * Fix #71: script to extract changelog information for notifications diff --git a/quickstarts/maven/docker-file-provided/pom.xml b/quickstarts/maven/docker-file-provided/pom.xml new file mode 100644 index 0000000000..0bc719acaf --- /dev/null +++ b/quickstarts/maven/docker-file-provided/pom.xml @@ -0,0 +1,118 @@ + + + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 2.2.6.RELEASE + + + org.eclipse.jkube.quickstarts.maven + docker-file-provided + 1.0.0-SNAPSHOT + Eclipse JKube :: Quickstarts :: Maven :: Docker File Provided + jar + + Minimal Example with Spring Boot and a provided external Dockerfile + + + + org.springframework.boot + spring-boot-starter-web + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + + kubernetes + + + + org.eclipse.jkube + kubernetes-maven-plugin + ${project.version} + + + + jkube/docker-file-provided + + ${project.basedir} + src/main/docker/Dockerfile + + + + + + + NodePort + ${artifactId} + 8080:8080 + + + + + + + + + + openshift + + + + org.eclipse.jkube + openshift-maven-plugin + ${project.version} + + + + jkube/docker-file-provided + + ${project.basedir} + src/main/docker/Dockerfile + + + + + + + NodePort + ${artifactId} + 8080:8080 + + + + + + + + + + + diff --git a/quickstarts/maven/docker-file-provided/src/main/docker/Dockerfile b/quickstarts/maven/docker-file-provided/src/main/docker/Dockerfile new file mode 100644 index 0000000000..4422147226 --- /dev/null +++ b/quickstarts/maven/docker-file-provided/src/main/docker/Dockerfile @@ -0,0 +1,4 @@ +FROM fabric8/s2i-java:latest-java11 +EXPOSE 8080/tcp +COPY maven/*.jar /opt/app.jar +ENTRYPOINT [ "java", "-jar", "/opt/app.jar" ] diff --git a/quickstarts/maven/docker-file-provided/src/main/java/org/eclipse/jkube/maven/sample/spring/boot/Application.java b/quickstarts/maven/docker-file-provided/src/main/java/org/eclipse/jkube/maven/sample/spring/boot/Application.java new file mode 100644 index 0000000000..70b07e455d --- /dev/null +++ b/quickstarts/maven/docker-file-provided/src/main/java/org/eclipse/jkube/maven/sample/spring/boot/Application.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 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 + */ +package org.eclipse.jkube.maven.sample.spring.boot; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + +} \ No newline at end of file diff --git a/quickstarts/maven/docker-file-provided/src/main/java/org/eclipse/jkube/maven/sample/spring/boot/HelloController.java b/quickstarts/maven/docker-file-provided/src/main/java/org/eclipse/jkube/maven/sample/spring/boot/HelloController.java new file mode 100644 index 0000000000..43fea02adc --- /dev/null +++ b/quickstarts/maven/docker-file-provided/src/main/java/org/eclipse/jkube/maven/sample/spring/boot/HelloController.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) 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 + */ +package org.eclipse.jkube.maven.sample.spring.boot; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @RequestMapping("/") + public String index() { + return "Greetings from Spring Boot with provided Dockerfile!"; + } + +}