-
Notifications
You must be signed in to change notification settings - Fork 500
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 #1354 from matthewbjones/feature/docker-build-cloud
Adds support for Docker Build Cloud
- Loading branch information
Showing
7 changed files
with
96 additions
and
1 deletion.
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
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,22 @@ | ||
class Kamal::Commands::Builder::Cloud < Kamal::Commands::Builder::Base | ||
# Expects `driver` to be of format "cloud docker-org-name/builder-name" | ||
|
||
def create | ||
docker :buildx, :create, "--driver", driver | ||
end | ||
|
||
def remove | ||
docker :buildx, :rm, builder_name | ||
end | ||
|
||
private | ||
def builder_name | ||
driver.gsub(/[ \/]/, "-") | ||
end | ||
|
||
def inspect_buildx | ||
pipe \ | ||
docker(:buildx, :inspect, builder_name), | ||
grep("-q", "Endpoint:.*cloud://.*") | ||
end | ||
end |
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
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
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
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
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 @@ | ||
service: app | ||
image: dhh/app | ||
servers: | ||
web: | ||
- "1.1.1.1" | ||
- "1.1.1.2" | ||
workers: | ||
- "1.1.1.3" | ||
- "1.1.1.4" | ||
registry: | ||
username: user | ||
password: pw | ||
|
||
accessories: | ||
mysql: | ||
image: mysql:5.7 | ||
host: 1.1.1.3 | ||
port: 3306 | ||
env: | ||
clear: | ||
MYSQL_ROOT_HOST: '%' | ||
secret: | ||
- MYSQL_ROOT_PASSWORD | ||
files: | ||
- test/fixtures/files/my.cnf:/etc/mysql/my.cnf | ||
directories: | ||
- data:/var/lib/mysql | ||
redis: | ||
image: redis:latest | ||
roles: | ||
- web | ||
port: 6379 | ||
directories: | ||
- data:/data | ||
|
||
readiness_delay: 0 | ||
|
||
builder: | ||
arch: <%= Kamal::Utils.docker_arch == "arm64" ? "amd64" : "arm64" %> | ||
driver: cloud example_org/cloud_builder |