-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4522 from jsternberg/compose-file
hack: add docker-compose file for development
- Loading branch information
Showing
4 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Use to set up a dev environment for buildkit. | ||
# Not meant for production deployments. | ||
# Use the same way you would use docker compose. | ||
# | ||
# $ hack/compose up -d --build | ||
# | ||
# Can be extended for local development by adding | ||
# a compose.override.yaml file to the same directory. | ||
# | ||
# Additional config files for extra services can | ||
# also be placed in the same folder and they will | ||
# be automatically ignored by git. | ||
# | ||
# To access the newly created development buildkit, | ||
# use either: | ||
# | ||
# $ buildctl --addr tcp://127.0.0.1:1234 ... | ||
# | ||
# or alternatively configure a new builder with buildx. | ||
# | ||
# $ docker buildx create \ | ||
# --bootstrap \ | ||
# --name dev \ | ||
# --driver remote \ | ||
# tcp://127.0.0.1:1234 | ||
# $ docker buildx --builder dev ... | ||
|
||
. $(dirname $0)/util | ||
set -eu -o pipefail | ||
|
||
filesDir=$(dirname $0)/composefiles | ||
|
||
args=(compose '-f' "$filesDir/compose.yaml") | ||
if [ -f "$filesDir/compose.override.yaml" ]; then | ||
args+=('-f' "$filesDir/compose.override.yaml") | ||
fi | ||
|
||
dockerCmd "${args[@]}" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Exclude everything to allow this folder to be used for other service | ||
# configurations. | ||
* | ||
|
||
# Specifically allow certain configuration files. | ||
!.gitignore | ||
!buildkitd.toml | ||
!compose.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
debug = true | ||
|
||
[grpc] | ||
address = [ "tcp://0.0.0.0:1234" ] | ||
debugAddress = "0.0.0.0:6060" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: buildkit | ||
services: | ||
buildkit: | ||
container_name: buildkit-dev | ||
build: | ||
context: ../.. | ||
args: | ||
BUILDKIT_DEBUG: 1 | ||
image: moby/buildkit:local | ||
ports: | ||
- 127.0.0.1:1234:1234 | ||
- 127.0.0.1:5000:5000 | ||
- 127.0.0.1:6060:6060 | ||
restart: always | ||
privileged: true | ||
environment: | ||
DELVE_PORT: 5000 | ||
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: http://jaeger:4317 | ||
configs: | ||
- source: buildkit_config | ||
target: /etc/buildkit/buildkitd.toml | ||
volumes: | ||
- buildkit:/var/lib/buildkit | ||
|
||
jaeger: | ||
image: jaegertracing/all-in-one:latest | ||
ports: | ||
- 127.0.0.1:16686:16686 | ||
|
||
volumes: | ||
buildkit: | ||
|
||
configs: | ||
buildkit_config: | ||
file: ./buildkitd.toml |