Skip to content

Commit 78e7d70

Browse files
author
lijianguo
committed
feat(buildpacks): add go java nodejs php python ruby rust
0 parents  commit 78e7d70

56 files changed

Lines changed: 4308 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.drone/drone.yml

Lines changed: 276 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,276 @@
1+
kind: pipeline
2+
type: docker
3+
name: linux-pack-amd64
4+
5+
platform:
6+
arch: amd64
7+
os: linux
8+
9+
steps:
10+
- name: test
11+
image: docker.io/drycc/go-dev
12+
pull: if-not-exists
13+
privileged: true
14+
commands:
15+
- STACK=20 make test-style
16+
environment:
17+
DEV_REGISTRY:
18+
from_secret: dev_registry
19+
DRYCC_REGISTRY:
20+
from_secret: drycc_registry
21+
CODECOV_TOKEN:
22+
from_secret: codecov_token
23+
when:
24+
event:
25+
- push
26+
- tag
27+
- pull_request
28+
volumes:
29+
- name: image_registries
30+
path: /etc/containers/registries.conf
31+
32+
- name: publish-pack
33+
image: docker.io/drycc/go-dev
34+
pull: if-not-exists
35+
privileged: true
36+
commands:
37+
- echo $DOCKER_PASSWORD | docker login $DRYCC_REGISTRY --username $DOCKER_USERNAME --password-stdin
38+
- STACK=20 VERSION=20-linux-amd64 make publish-pack
39+
environment:
40+
DEV_REGISTRY:
41+
from_secret: dev_registry
42+
DRYCC_REGISTRY:
43+
from_secret: drycc_registry
44+
DOCKER_USERNAME:
45+
from_secret: docker_username
46+
DOCKER_PASSWORD:
47+
from_secret: docker_password
48+
when:
49+
event:
50+
- push
51+
- tag
52+
volumes:
53+
- name: image_registries
54+
path: /etc/containers/registries.conf
55+
56+
trigger:
57+
event:
58+
- push
59+
- tag
60+
- pull_request
61+
62+
volumes:
63+
- name: image_registries
64+
host:
65+
path: /etc/containers/registries.conf
66+
67+
---
68+
kind: pipeline
69+
type: docker
70+
name: linux-pack-arm64
71+
72+
platform:
73+
arch: arm64
74+
os: linux
75+
76+
steps:
77+
- name: publish
78+
image: docker.io/drycc/go-dev
79+
pull: if-not-exists
80+
privileged: true
81+
commands:
82+
- echo $DOCKER_PASSWORD | docker login $DRYCC_REGISTRY --username $DOCKER_USERNAME --password-stdin
83+
- STACK=20 VERSION=20-linux-arm64 make publish-pack
84+
environment:
85+
DEV_REGISTRY:
86+
from_secret: dev_registry
87+
DRYCC_REGISTRY:
88+
from_secret: drycc_registry
89+
DOCKER_USERNAME:
90+
from_secret: docker_username
91+
DOCKER_PASSWORD:
92+
from_secret: docker_password
93+
volumes:
94+
- name: image_registries
95+
path: /etc/containers/registries.conf
96+
97+
trigger:
98+
event:
99+
- push
100+
- tag
101+
102+
---
103+
kind: pipeline
104+
type: docker
105+
name: manifest-pack
106+
107+
steps:
108+
- name: generate manifest
109+
image: docker.io/library/alpine
110+
pull: if-not-exists
111+
commands:
112+
- sed -i "s/docker.io/$${DRYCC_REGISTRY}/g" .drone/manifest.tmpl
113+
- sed -i "s/docker.io/$${DRYCC_REGISTRY}/g" .drone/manifest-build.tmpl
114+
environment:
115+
DRYCC_REGISTRY:
116+
from_secret: drycc_registry
117+
118+
- name: publish-20
119+
image: plugins/manifest
120+
settings:
121+
spec: .drone/manifest.tmpl
122+
username:
123+
from_secret: docker_username
124+
password:
125+
from_secret: docker_password
126+
environment:
127+
STACK: 20
128+
DEV_REGISTRY:
129+
from_secret: dev_registry
130+
DRYCC_REGISTRY:
131+
from_secret: drycc_registry
132+
133+
- name: publish-20-build
134+
image: plugins/manifest
135+
settings:
136+
spec: .drone/manifest-build.tmpl
137+
username:
138+
from_secret: docker_username
139+
password:
140+
from_secret: docker_password
141+
environment:
142+
STACK: 20
143+
DEV_REGISTRY:
144+
from_secret: dev_registry
145+
DRYCC_REGISTRY:
146+
from_secret: drycc_registry
147+
148+
trigger:
149+
event:
150+
- push
151+
- tag
152+
153+
depends_on:
154+
- linux-pack-amd64
155+
- linux-pack-arm64
156+
157+
---
158+
kind: pipeline
159+
type: docker
160+
name: linux-buildpacks-arm64
161+
162+
platform:
163+
arch: amd64
164+
os: linux
165+
166+
steps:
167+
- name: publish
168+
image: docker.io/drycc/go-dev
169+
pull: if-not-exists
170+
privileged: true
171+
commands:
172+
- echo $DOCKER_PASSWORD | docker login $DRYCC_REGISTRY --username $DOCKER_USERNAME --password-stdin
173+
- STACK=20 VERSION=20-linux-amd64 make publish-buildpack
174+
environment:
175+
DEV_REGISTRY:
176+
from_secret: dev_registry
177+
DRYCC_REGISTRY:
178+
from_secret: drycc_registry
179+
DOCKER_USERNAME:
180+
from_secret: docker_username
181+
DOCKER_PASSWORD:
182+
from_secret: docker_password
183+
volumes:
184+
- name: image_registries
185+
path: /etc/containers/registries.conf
186+
187+
trigger:
188+
event:
189+
- push
190+
- tag
191+
192+
depends_on:
193+
- manifest-pack
194+
195+
---
196+
kind: pipeline
197+
type: docker
198+
name: linux-buildpacks-arm64
199+
200+
platform:
201+
arch: arm64
202+
os: linux
203+
204+
steps:
205+
- name: publish
206+
image: docker.io/drycc/go-dev
207+
pull: if-not-exists
208+
privileged: true
209+
commands:
210+
- echo $DOCKER_PASSWORD | docker login $DRYCC_REGISTRY --username $DOCKER_USERNAME --password-stdin
211+
- STACK=20 VERSION=20-linux-arm64 make publish-buildpack
212+
environment:
213+
DEV_REGISTRY:
214+
from_secret: dev_registry
215+
DRYCC_REGISTRY:
216+
from_secret: drycc_registry
217+
DOCKER_USERNAME:
218+
from_secret: docker_username
219+
DOCKER_PASSWORD:
220+
from_secret: docker_password
221+
volumes:
222+
- name: image_registries
223+
path: /etc/containers/registries.conf
224+
225+
trigger:
226+
event:
227+
- push
228+
- tag
229+
230+
depends_on:
231+
- manifest-pack
232+
233+
---
234+
kind: pipeline
235+
type: docker
236+
name: manifest-buildpacks
237+
238+
steps:
239+
- name: generate manifest
240+
image: docker.io/library/alpine
241+
pull: if-not-exists
242+
commands:
243+
- sed -i "s/docker.io/$${DRYCC_REGISTRY}/g" .drone/manifest-buildpacks.tmpl
244+
- sed -i "s/docker.io/${DRYCC_REGISTRY}/g" builder.toml
245+
environment:
246+
DRYCC_REGISTRY:
247+
from_secret: drycc_registry
248+
249+
- name: publish-20-buildpacks
250+
image: plugins/manifest
251+
settings:
252+
spec: .drone/manifest-buildpacks.tmpl
253+
username:
254+
from_secret: docker_username
255+
password:
256+
from_secret: docker_password
257+
environment:
258+
STACK: 20
259+
DEV_REGISTRY:
260+
from_secret: dev_registry
261+
DRYCC_REGISTRY:
262+
from_secret: drycc_registry
263+
264+
trigger:
265+
event:
266+
- push
267+
- tag
268+
269+
depends_on:
270+
- linux-buildpacks-amd64
271+
- linux-buildpacks-arm64
272+
273+
volumes:
274+
- name: image_registries
275+
host:
276+
path: /etc/containers/registries.conf

.drone/manifest-build.tmpl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
image: docker.io/drycc/pack:${STACK}-build
2+
manifests:
3+
-
4+
image: docker.io/drycc/pack:${STACK}-linux-amd64-build
5+
platform:
6+
architecture: amd64
7+
os: linux
8+
-
9+
image: docker.io/drycc/pack:${STACK}-linux-arm64-build
10+
platform:
11+
architecture: arm64
12+
os: linux
13+

.drone/manifest-buildpacks.tmpl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
image: docker.io/drycc/buildpacks:${STACK}
2+
manifests:
3+
-
4+
image: docker.io/drycc/buildpacks:${STACK}-linux-amd64
5+
platform:
6+
architecture: amd64
7+
os: linux
8+
-
9+
image: docker.io/drycc/buildpacks:${STACK}-linux-arm64
10+
platform:
11+
architecture: arm64
12+
os: linux
13+

.drone/manifest.tmpl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
image: docker.io/drycc/pack:${STACK}
2+
manifests:
3+
-
4+
image: docker.io/drycc/pack:${STACK}-linux-amd64
5+
platform:
6+
architecture: amd64
7+
os: linux
8+
-
9+
image: docker.io/drycc/pack:${STACK}-linux-arm64
10+
platform:
11+
architecture: arm64
12+
os: linux

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea
2+
*.iml
3+
.tools

Dockerfile.build

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
ARG BASE_IMAGE
2+
FROM ${BASE_IMAGE}
3+
4+
ARG pack_uid=1000
5+
ARG pack_gid=1000
6+
7+
ADD rootfs /
8+
9+
RUN groupadd drycc --gid ${pack_gid} && \
10+
useradd drycc -u ${pack_uid} -g ${pack_gid} -s /bin/bash -m
11+
RUN mkdir /app && \
12+
chown drycc:drycc /app /usr/src /var/lib
13+
RUN chmod +x /usr/local/bin/* && \
14+
install-tools.sh
15+
16+
ENV CNB_USER_ID=${pack_uid}
17+
ENV CNB_GROUP_ID=${pack_gid}
18+
19+
ARG STACK
20+
ENV STACK "${STACK}"
21+
ENV CNB_STACK_ID "${STACK}"
22+
LABEL io.buildpacks.stack.id="${STACK}"
23+
24+
USER drycc

Dockerfile.run

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
ARG BASE_IMAGE
2+
FROM ${BASE_IMAGE}
3+
4+
RUN ln -s /workspace /app
5+
6+
ARG pack_uid=1000
7+
ARG pack_gid=1000
8+
9+
RUN groupadd drycc --gid ${pack_gid} && \
10+
useradd drycc -u ${pack_uid} -g ${pack_gid} -s /bin/bash -m && \
11+
chown drycc:drycc /usr/src /var/lib
12+
13+
RUN apt-get update && apt-get install autoconf -y
14+
15+
ARG STACK
16+
LABEL io.buildpacks.stack.id="${STACK}"
17+
USER drycc
18+
ENV HOME /app

0 commit comments

Comments
 (0)