File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
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" ]
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments