Skip to content

Commit b2af4bd

Browse files
committed
Hello world application
(cherry picked from commit f2c76ad6214350c6ca93ea74ed6765c48613e32d)
1 parent 6bacebf commit b2af4bd

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

openshift-app-sample/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM golang:1.15 as builder
2+
ENV APP_USER app
3+
ENV APP_HOME /go/src/openshift-app-sample
4+
RUN groupadd $APP_USER && useradd -m -g $APP_USER -l $APP_USER
5+
RUN mkdir -p $APP_HOME && chown -R $APP_USER:$APP_USER $APP_HOME
6+
WORKDIR $APP_HOME
7+
USER $APP_USER
8+
COPY src/ .
9+
RUN go build -o openshift-app-sample
10+
11+
FROM golang:1.15
12+
ENV APP_USER app
13+
ENV APP_HOME /go/src/openshift-app-sample
14+
RUN groupadd $APP_USER && useradd -m -g $APP_USER -l $APP_USER
15+
RUN mkdir -p $APP_HOME
16+
WORKDIR $APP_HOME
17+
COPY --chown=0:0 --from=builder $APP_HOME/openshift-app-sample $APP_HOME
18+
USER $APP_USER
19+
CMD ["./openshift-app-sample"]

openshift-app-sample/src/main.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright (c) IBM Corporation 2021.
2+
//
3+
// This program and the accompanying materials are made available under the
4+
// terms of the Eclipse Public License 2.0, which is available at
5+
// http://www.eclipse.org/legal/epl-2.0.
6+
//
7+
// SPDX-License-Identifier: EPL-2.0
8+
9+
// Package main provides the entry point for a executable application.
10+
package main
11+
12+
import "fmt"
13+
14+
func main() {
15+
fmt.Println("Hello World!!!")
16+
}

openshift-app-sample/src/src

2.03 MB
Binary file not shown.

0 commit comments

Comments
 (0)