Skip to content

Commit

Permalink
Merge pull request #24 from devzero-inc/staging
Browse files Browse the repository at this point in the history
merge staging to main
  • Loading branch information
dray92 authored Jun 18, 2024
2 parents 0a07224 + ae8b4b4 commit 704a78a
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 10 deletions.
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
* [Connect to an RDS Instance](product-guides/how-tos/connect-to-an-rds-instance.md)
* [Connect to an S3 Bucket](product-guides/how-tos/connect-to-an-s3-bucket.md)
* [Run GitHub Actions in a DevBox](how-to-guides/run-github-actions-in-a-devbox.md)
* [Docker remote build/cache](how-to-guides/docker-remote-build-cache.md)

## 🛠️ Troubleshooting

Expand Down
61 changes: 61 additions & 0 deletions how-to-guides/docker-remote-build-cache.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Docker remote build/cache

### Remote build/cache using `DOCKER_HOST`

1. Create a new workspace with Docker installed ([How-to](../references/common-tools/build-tools/docker.md)).
2. Make sure your machine is connected to the DevZero network:\
`dz net connect`
3. Set `DOCKER_HOST` environment variable on your machine to match the DevBox hostname:\
`export DOCKER_HOST=ssh://devzero@your-devbox-hostname`
4. Verify the installation by running:

`docker info`

When you run a `docker build` command, the build context will be sent to the DevBox and the build process will run.

{% hint style="info" %}
If you're seeing "Host key verification failed" error, try connecting to your DevBox via ssh to verify the fingerprint.
{% endhint %}

### Remote build using BuildKit

1. Create a new workspace with Docker installed ([How-to](../references/common-tools/build-tools/docker.md)).
2. Inside your DevBox, install buildkit using Docker Image:\
`docker run -d --rm --name=remote-buildkitd --privileged -p 1234:1234 moby/buildkit:latest --addr tcp://0.0.0.0:1234`\
\
See [Remote driver docs](https://docs.docker.com/build/drivers/remote/) for available options.
3. On your machine, create a new buildx instance:\
`docker buildx create --name remote-container --driver remote tcp://your-devbox-hostname:1234`
4. Build an image using remote driver (and download it locally):\
`docker buildx build --builder=remote-container -t test --load .`

### Remote cache using Docker Registry

1. Create a new workspace with Docker installed ([How-to](../references/common-tools/build-tools/docker.md)).
2. Inside your DevBox, install the Docker Registry image:\
`docker run -d -p 5000:5000 --name registry registry:2`\
\
See [CNCF Distribution guide](https://distribution.github.io/distribution/) for available options.
3. Make sure your machine is connected to the DevZero network:\
`dz net connect`
4. Verify you can access the registry from your machine:\
`curl http://your-devbox-hostname:5000/v2/_catalog`
5. Build and push your image to the registry\
With Docker:\
`docker build --push -t your-devbox-hostname:5000/<image> .`\
\
With BuildKit remote cache (see previous section):

```console
docker buildx build --push -t your-devbox-hostname:5000/<image> \
--cache-to type=registry,ref=your-devbox-hostname:5000/<cache-image> \
--cache-from type=registry,ref=your-devbox-hostname:5000/<cache-image>
```
6. Verify the image is available on the machine:\
`curl http://your-devbox-hostname:5000/v2/_catalog`

{% hint style="info" %}
If you're getting "http: server gave HTTP response to HTTPS client", try adding the following to your Docker daemon json configuration:\
\
`insecure-registries": ["your-devbox-hostname:5000"]`
{% endhint %}
4 changes: 2 additions & 2 deletions how-to-guides/run-github-actions-in-a-devbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ launch:
command: |
cd actions-runner
./svc.sh install && ./svc.sh start
directory: /home/devzero needed?
directory: /home/devzero
user: root
```
Expand All @@ -56,7 +56,7 @@ curl \
6. Verify that your runner was added to your repo/org and is either in "Idle" or "Online" state.

{% hint style="info" %}
Tip: The runner name should be the same as the DevBox hostname.
Tip: The runner name should be same as the DevBox hostname.
{% endhint %}

7. Run a GitHub Action on the self-hosted runner to verify that it passes successfully:
Expand Down
13 changes: 5 additions & 8 deletions product-guides/how-tos/connect-to-an-rds-instance.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# Connect to an RDS Instance

## Using a Recipe Step
### Existing Database

{% hint style="info" %}
**Coming soon...**
{% endhint %}
1. Make sure your followed the [Connecting to AWS](../../how-to-guides/connecting-to-aws.md) guide.

## From a running Workspace
### New Database

1. Make sure your followed the [Connecting to AWS](../../how-to-guides/connecting-to-aws.md) guide.

{% hint style="info" %}
**Coming soon...**
{% endhint %}

0 comments on commit 704a78a

Please sign in to comment.