Skip to content

Commit fd97b76

Browse files
authored
Add docs for AWS CodeBuild and Tekton (#5614)
1 parent d3cb25e commit fd97b76

File tree

3 files changed

+114
-0
lines changed

3 files changed

+114
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# AWS CodeBuild
2+
3+
To enable access to Docker in AWS CodeBuild, go to `Privileged` section and check
4+
`Enable this flag if you want to build Docker images or want your builds to get elevated privileges`.
5+
6+
This is a sample `buildspec.yml` config:
7+
8+
```yaml
9+
version: 0.2
10+
11+
phases:
12+
install:
13+
runtime-versions:
14+
java: corretto17
15+
build:
16+
commands:
17+
- ./mvnw test
18+
```
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Tekton
2+
3+
o enable access to Docker in Tekton, a dind sidecar needs to be added. An example of it can be found
4+
[here](https://github.com/tektoncd/pipeline/blob/main/examples/v1beta1/taskruns/dind-sidecar.yaml)
5+
6+
This is an example
7+
8+
```yaml
9+
apiVersion: tekton.dev/v1beta1
10+
kind: Task
11+
metadata:
12+
name: run-tests
13+
description: Run Tests
14+
spec:
15+
workspaces:
16+
- name: source
17+
steps:
18+
- name: read
19+
image: eclipse-temurin:17.0.3_7-jdk-alpine
20+
workingDir: $(workspaces.source.path)
21+
script: ./mvnw test
22+
volumeMounts:
23+
- mountPath: /var/run/
24+
name: dind-socket
25+
sidecars:
26+
- image: docker:20.10-dind
27+
name: docker
28+
securityContext:
29+
privileged: true
30+
volumeMounts:
31+
- mountPath: /var/lib/docker
32+
name: dind-storage
33+
- mountPath: /var/run/
34+
name: dind-socket
35+
volumes:
36+
- name: dind-storage
37+
emptyDir: { }
38+
- name: dind-socket
39+
emptyDir: { }
40+
---
41+
apiVersion: tekton.dev/v1beta1
42+
kind: Pipeline
43+
metadata:
44+
name: testcontainers-demo
45+
spec:
46+
description: |
47+
This pipeline clones a git repo, run testcontainers.
48+
params:
49+
- name: repo-url
50+
type: string
51+
description: The git repo URL to clone from.
52+
workspaces:
53+
- name: shared-data
54+
description: |
55+
This workspace contains the cloned repo files, so they can be read by the
56+
next task.
57+
tasks:
58+
- name: fetch-source
59+
taskRef:
60+
name: git-clone
61+
workspaces:
62+
- name: output
63+
workspace: shared-data
64+
params:
65+
- name: url
66+
value: $(params.repo-url)
67+
- name: run-tests
68+
runAfter: ["fetch-source"]
69+
taskRef:
70+
name: run-tests
71+
workspaces:
72+
- name: source
73+
workspace: shared-data
74+
---
75+
apiVersion: tekton.dev/v1beta1
76+
kind: PipelineRun
77+
metadata:
78+
name: testcontainers-demo-run
79+
spec:
80+
pipelineRef:
81+
name: testcontainers-demo
82+
workspaces:
83+
- name: shared-data
84+
volumeClaimTemplate:
85+
spec:
86+
accessModes:
87+
- ReadWriteOnce
88+
resources:
89+
requests:
90+
storage: 1Gi
91+
params:
92+
- name: repo-url
93+
value: https://github.com/testcontainers/testcontainers-java-repro.git
94+
```

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,13 @@ nav:
8888
- System Requirements:
8989
- supported_docker_environment/index.md
9090
- Continuous Integration:
91+
- supported_docker_environment/continuous_integration/aws_codebuild.md
9192
- supported_docker_environment/continuous_integration/dind_patterns.md
9293
- supported_docker_environment/continuous_integration/circle_ci.md
9394
- supported_docker_environment/continuous_integration/drone.md
9495
- supported_docker_environment/continuous_integration/gitlab_ci.md
9596
- supported_docker_environment/continuous_integration/bitbucket_pipelines.md
97+
- supported_docker_environment/continuous_integration/tekton.md
9698
- supported_docker_environment/windows.md
9799
- supported_docker_environment/logging_config.md
98100
- supported_docker_environment/image_registry_rate_limiting.md

0 commit comments

Comments
 (0)