Skip to content

Commit

Permalink
Hello world application
Browse files Browse the repository at this point in the history
(cherry picked from commit f2c76ad6214350c6ca93ea74ed6765c48613e32d)
  • Loading branch information
matrober-uk committed Feb 12, 2021
1 parent 6bacebf commit b2af4bd
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
19 changes: 19 additions & 0 deletions openshift-app-sample/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM golang:1.15 as builder
ENV APP_USER app
ENV APP_HOME /go/src/openshift-app-sample
RUN groupadd $APP_USER && useradd -m -g $APP_USER -l $APP_USER
RUN mkdir -p $APP_HOME && chown -R $APP_USER:$APP_USER $APP_HOME
WORKDIR $APP_HOME
USER $APP_USER
COPY src/ .
RUN go build -o openshift-app-sample

FROM golang:1.15
ENV APP_USER app
ENV APP_HOME /go/src/openshift-app-sample
RUN groupadd $APP_USER && useradd -m -g $APP_USER -l $APP_USER
RUN mkdir -p $APP_HOME
WORKDIR $APP_HOME
COPY --chown=0:0 --from=builder $APP_HOME/openshift-app-sample $APP_HOME
USER $APP_USER
CMD ["./openshift-app-sample"]
16 changes: 16 additions & 0 deletions openshift-app-sample/src/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright (c) IBM Corporation 2021.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License 2.0, which is available at
// http://www.eclipse.org/legal/epl-2.0.
//
// SPDX-License-Identifier: EPL-2.0

// Package main provides the entry point for a executable application.
package main

import "fmt"

func main() {
fmt.Println("Hello World!!!")
}
Binary file added openshift-app-sample/src/src
Binary file not shown.

0 comments on commit b2af4bd

Please sign in to comment.