File tree Expand file tree Collapse file tree 5 files changed +240
-1
lines changed
Expand file tree Collapse file tree 5 files changed +240
-1
lines changed Original file line number Diff line number Diff line change 1+ schemaVersion : 2.2.0
2+ metadata :
3+ name : go
4+ displayName : Go Runtime
5+ description : Go (version 1.25.x) is an open source programming language that makes it easy to build simple, reliable, and efficient software.
6+ icon : https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg
7+ tags :
8+ - Go
9+ projectType : Go
10+ language : Go
11+ provider : Red Hat
12+ version : 1.5.0
13+ starterProjects :
14+ - name : go-starter
15+ description : A Go project with a simple HTTP server
16+ git :
17+ checkoutFrom :
18+ revision : v1.5.0
19+ remotes :
20+ origin : https://github.com/devfile-samples/devfile-stack-go.git
21+ components :
22+ - container :
23+ endpoints :
24+ - name : https-go
25+ targetPort : 8080
26+ protocol : https
27+ - exposure : none
28+ name : debug
29+ targetPort : 5858
30+ image : registry.access.redhat.com/ubi9/go-toolset:1.25.5-1770654497
31+ args : ["tail", "-f", "/dev/null"]
32+ env :
33+ - name : DEBUG_PORT
34+ value : ' 5858'
35+ memoryLimit : 1024Mi
36+ mountSources : true
37+ name : runtime
38+ commands :
39+ - exec :
40+ env :
41+ - name : GOPATH
42+ value : ${PROJECT_SOURCE}/.go
43+ - name : GOCACHE
44+ value : ${PROJECT_SOURCE}/.cache
45+ commandLine : go build main.go
46+ component : runtime
47+ group :
48+ isDefault : true
49+ kind : build
50+ workingDir : ${PROJECT_SOURCE}
51+ id : build
52+ - exec :
53+ commandLine : ./main
54+ component : runtime
55+ group :
56+ isDefault : true
57+ kind : run
58+ workingDir : ${PROJECT_SOURCE}
59+ id : run
60+ - exec :
61+ env :
62+ - name : GOPATH
63+ value : ${PROJECT_SOURCE}/.go
64+ - name : GOCACHE
65+ value : ${PROJECT_SOURCE}/.cache
66+ commandLine : |
67+ dlv \
68+ --listen=127.0.0.1:${DEBUG_PORT} \
69+ --only-same-user=false \
70+ --headless=true \
71+ --api-version=2 \
72+ --accept-multiclient \
73+ debug --continue main.go
74+ component : runtime
75+ group :
76+ isDefault : true
77+ kind : debug
78+ workingDir : ${PROJECT_SOURCE}
79+ id : debug
Original file line number Diff line number Diff line change 1+ schemaVersion : 2.2.2
2+ metadata :
3+ name : go
4+ displayName : Go Runtime
5+ description : Go (version 1.25.x) is an open source programming language that makes it easy to build simple, reliable, and efficient software.
6+ icon : https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg
7+ tags :
8+ - Go
9+ projectType : Go
10+ language : Go
11+ provider : Red Hat
12+ version : 2.6.0
13+ starterProjects :
14+ - name : go-starter
15+ description : A Go project with a simple HTTP server
16+ git :
17+ checkoutFrom :
18+ revision : v2.6.0
19+ remotes :
20+ origin : https://github.com/devfile-samples/devfile-stack-go.git
21+ components :
22+ - name : build
23+ image :
24+ imageName : go-image:latest
25+ dockerfile :
26+ uri : docker/Dockerfile
27+ buildContext : .
28+ rootRequired : false
29+ - name : deploy
30+ kubernetes :
31+ uri : kubernetes/deploy.yaml
32+ endpoints :
33+ - name : http-8081
34+ targetPort : 8081
35+ - container :
36+ endpoints :
37+ - name : https-go
38+ protocol : https
39+ targetPort : 8080
40+ - exposure : none
41+ name : debug
42+ targetPort : 5858
43+ image : registry.access.redhat.com/ubi9/go-toolset:1.25.5-1770654497
44+ args : ['tail', '-f', '/dev/null']
45+ env :
46+ - name : DEBUG_PORT
47+ value : ' 5858'
48+ memoryLimit : 1024Mi
49+ mountSources : true
50+ name : runtime
51+ commands :
52+ - id : build-image
53+ apply :
54+ component : build
55+ - id : deployk8s
56+ apply :
57+ component : deploy
58+ - id : deploy
59+ composite :
60+ commands :
61+ - build-image
62+ - deployk8s
63+ group :
64+ kind : deploy
65+ isDefault : true
66+ - exec :
67+ env :
68+ - name : GOPATH
69+ value : ${PROJECT_SOURCE}/.go
70+ - name : GOCACHE
71+ value : ${PROJECT_SOURCE}/.cache
72+ commandLine : go build main.go
73+ component : runtime
74+ group :
75+ isDefault : true
76+ kind : build
77+ workingDir : ${PROJECT_SOURCE}
78+ id : build
79+ - exec :
80+ commandLine : ./main
81+ component : runtime
82+ group :
83+ isDefault : true
84+ kind : run
85+ workingDir : ${PROJECT_SOURCE}
86+ id : run
87+
88+ - exec :
89+ commandLine : |
90+ GOPATH=${PROJECT_SOURCE}/.go \
91+ GOCACHE=${PROJECT_SOURCE}/.cache \
92+ dlv \
93+ --listen=127.0.0.1:${DEBUG_PORT} \
94+ --only-same-user=false \
95+ --headless=true \
96+ --api-version=2 \
97+ --accept-multiclient \
98+ debug --continue main.go
99+ component : runtime
100+ group :
101+ isDefault : true
102+ kind : debug
103+ workingDir : ${PROJECT_SOURCE}
104+ id : debug
Original file line number Diff line number Diff line change 1+ FROM registry.access.redhat.com/ubi9/go-toolset:1.25.5-1770654497
2+
3+ COPY go.mod ./
4+ RUN go mod download
5+
6+ COPY *.go ./
7+
8+ RUN go build -o ./main
9+
10+ EXPOSE 8081
11+
12+ CMD [ "./main" , "-p=8081" ]
Original file line number Diff line number Diff line change 1+ kind : Service
2+ apiVersion : v1
3+ metadata :
4+ name : my-go-svc
5+ spec :
6+ ports :
7+ - name : http-8081
8+ port : 8081
9+ protocol : TCP
10+ targetPort : 8081
11+ selector :
12+ app : go-app
13+ ---
14+ kind : Deployment
15+ apiVersion : apps/v1
16+ metadata :
17+ name : my-go
18+ spec :
19+ replicas : 1
20+ selector :
21+ matchLabels :
22+ app : go-app
23+ template :
24+ metadata :
25+ labels :
26+ app : go-app
27+ spec :
28+ containers :
29+ - name : my-go
30+ image : go-image:latest
31+ ports :
32+ - name : http
33+ containerPort : 8081
34+ protocol : TCP
35+ resources :
36+ requests :
37+ memory : " 10Mi"
38+ cpu : " 10m"
39+ limits :
40+ memory : " 100Mi"
41+ cpu : " 100m"
Original file line number Diff line number Diff line change @@ -10,13 +10,13 @@ versions:
1010 - version : 1.2.0
1111 # 1.2.1: use https protocol for endpoint
1212 - version : 1.2.1
13- default : true # should have one and only one default version
1413 # 1.3.0: debug command via dlv & go 1.20
1514 - version : 1.3.0
1615 # 1.3.1: use https protocol for endpoint
1716 - version : 1.3.1
1817 # 1.4.0: go 1.24
1918 - version : 1.4.0
19+ - version : 1.5.0
2020 - version : 2.0.0
2121 # 2.1.0: debug command via dlv
2222 - version : 2.1.0
@@ -28,3 +28,6 @@ versions:
2828 - version : 2.4.0
2929 # 2.5.0: debug command via dlv & go 1.24
3030 - version : 2.5.0
31+ # 2.6.0: updated runtime image version
32+ - version : 2.6.0
33+ default : true # should have one and only one default version
You can’t perform that action at this time.
0 commit comments