Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/docs-0.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcb committed May 24, 2024
2 parents 2f61ff7 + 0abf6bf commit 3755bcb
Show file tree
Hide file tree
Showing 31 changed files with 117 additions and 81 deletions.
16 changes: 8 additions & 8 deletions docs/basics/part-6-using-docker-with-earthly.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Examples in [Python](#more-examples), [JavaScript](#more-examples) and [Java](#m

You may find that you need to run Docker commands inside a target. For those cases Earthly offers `WITH DOCKER`. `WITH DOCKER` will initialize a Docker daemon that can be used in the context of a `RUN` command.

Whenever you need to use `WITH DOCKER` we recommend (though it is not required) that you use Earthly's own Docker in Docker (dind) image: `earthly/dind:alpine-3.19-docker-25.0.2-r0`.
Whenever you need to use `WITH DOCKER` we recommend (though it is not required) that you use Earthly's own Docker in Docker (dind) image: `earthly/dind:alpine-3.19-docker-25.0.5-r0`.

Notice `WITH DOCKER` creates a block of code that has an `END` keyword. Everything that happens within this block is going to take place within our `earthly/dind:alpine-3.19-docker-25.0.2-r0` container.
Notice `WITH DOCKER` creates a block of code that has an `END` keyword. Everything that happens within this block is going to take place within our `earthly/dind:alpine-3.19-docker-25.0.5-r0` container.

### Pulling an Image
```Dockerfile
hello:
FROM earthly/dind:alpine-3.19-docker-25.0.2-r0
FROM earthly/dind:alpine-3.19-docker-25.0.5-r0
WITH DOCKER --pull hello-world
RUN docker run hello-world
END
Expand All @@ -35,7 +35,7 @@ my-hello-world:
SAVE IMAGE my-hello:latest

hello:
FROM earthly/dind:alpine-3.19-docker-25.0.2-r0
FROM earthly/dind:alpine-3.19-docker-25.0.5-r0
WITH DOCKER --load hello:latest=+my-hello-world
RUN docker run hello:latest
END
Expand Down Expand Up @@ -137,7 +137,7 @@ test-setup:
SAVE IMAGE test:latest
integration-tests:
FROM earthly/dind:alpine-3.19-docker-25.0.2-r0
FROM earthly/dind:alpine-3.19-docker-25.0.5-r0
COPY docker-compose.yml ./
WITH DOCKER --compose docker-compose.yml --load tests:latest=+test-setup
RUN docker run --network=default_go/part6_default tests:latest
Expand Down Expand Up @@ -346,7 +346,7 @@ api-docker:

# Run your app and api side by side
app-with-api:
FROM earthly/dind:alpine-3.19-docker-25.0.2-r0
FROM earthly/dind:alpine-3.19-docker-25.0.5-r0
RUN apk add curl
WITH DOCKER \
--load app:latest=+app-docker \
Expand Down Expand Up @@ -401,7 +401,7 @@ docker:
SAVE IMAGE java-example:$tag

with-postgresql:
FROM earthly/dind:alpine-3.19-docker-25.0.2-r0
FROM earthly/dind:alpine-3.19-docker-25.0.5-r0
COPY ./docker-compose.yml .
RUN apk update
RUN apk add postgresql-client
Expand Down Expand Up @@ -559,7 +559,7 @@ build:
COPY . .
run-tests:
FROM earthly/dind:alpine-3.19-docker-25.0.2-r0
FROM earthly/dind:alpine-3.19-docker-25.0.5-r0
COPY ./docker-compose.yml .
COPY ./tests ./tests
RUN apk update
Expand Down
4 changes: 2 additions & 2 deletions docs/basics/part-8a-using-earthly-in-your-current-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
steps:
- uses: earthly/actions/setup-earthly@v1
with:
version: v0.8.6
version: v0.8.12
- uses: actions/checkout@v2
- name: Docker Login
run: docker login --username "$DOCKERHUB_USERNAME" --password "$DOCKERHUB_TOKEN"
Expand All @@ -51,7 +51,7 @@ jobs:
Here is an explanation of the steps above:
* The action `earthly/actions/setup-earthly@v1` downloads and installs Earthly. Running this action is similar to running the Earthly installation one-liner `sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.8.6/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'`
* The action `earthly/actions/setup-earthly@v1` downloads and installs Earthly. Running this action is similar to running the Earthly installation one-liner `sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.8.12/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'`
* The command `docker login` performs a login to the DockerHub registry. This is required, to prevent rate-limiting issues when using popular base images.
* The command `earthly --org ... --sat ... --ci --push +build` executes the build. The `--ci` flag is used here, in order to force the use of `--strict` mode. In `--strict` mode, Earthly prevents the use of features that make the build less repeatable and also disables local outputs -- because artifacts and images resulting from the build are not needed within the CI environment. Any outputs should be pushed via `RUN --push` or `SAVE IMAGE --push` commands. The flags `--org` and `--sat` allow you to select the organization and satellite to use for the build. If no satellite is specified, the build will be executed in the CI environment itself, with limited caching.

Expand Down
4 changes: 2 additions & 2 deletions docs/ci-integration/build-an-earthly-ci-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This guide will cover both approaches to constructing your image.
This is the recommended approach when adopting Earthly into your containerized CI. Start by basing your custom image on ours:

```docker
FROM earthly/earthly:v0.8.6
FROM earthly/earthly:v0.8.12
RUN ... # Add your agent, certificates, tools...
```

Expand Down Expand Up @@ -50,7 +50,7 @@ In this setup, Earthly will be allowed to manage an instance of its `earthly/bui
To enable this, simply follow the installation instructions within your Dockerfile/Earthfile as you would on any other host. An example of installing this can be found below.

```docker
RUN wget https://github.com/earthly/earthly/releases/download/v0.8.6/earthly-linux-amd64 -O /usr/local/bin/earthly && \
RUN wget https://github.com/earthly/earthly/releases/download/v0.8.12/earthly-linux-amd64 -O /usr/local/bin/earthly && \
chmod +x /usr/local/bin/earthly && \
/usr/local/bin/earthly bootstrap
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ You can however, run Earthly builds on Bitbucket pipelines via [remote runners](
```yml
# ./bitbucket-pipelines.yml

image: earthly/earthly:v0.8.6
image: earthly/earthly:v0.8.12

pipelines:
default:
Expand Down
2 changes: 1 addition & 1 deletion docs/ci-integration/guides/circle-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- checkout
- run: docker login --username "$DOCKERHUB_USERNAME" --password "$DOCKERHUB_TOKEN"
- run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.8.6/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'"
- run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.8.12/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'"
- run: earthly --ci --push +build
```
Expand Down
2 changes: 1 addition & 1 deletion docs/ci-integration/guides/codebuild-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ version: 0.2
phases:
install:
commands:
- wget https://github.com/earthly/earthly/releases/download/v0.8.6/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly
- wget https://github.com/earthly/earthly/releases/download/v0.8.12/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly
pre_build:
commands:
- echo Logging into Docker
Expand Down
2 changes: 1 addition & 1 deletion docs/ci-integration/guides/gh-actions-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Docker Login
run: docker login --username "$DOCKERHUB_USERNAME" --password "$DOCKERHUB_TOKEN"
- name: Download latest earthly
run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.8.6/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'"
run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.8.12/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'"
- name: Run build
run: earthly --ci --push +build
```
Expand Down
2 changes: 1 addition & 1 deletion docs/ci-integration/guides/gitlab-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ variables:
FORCE_COLOR: 1
EARTHLY_EXEC_CMD: "/bin/sh"

image: earthly/earthly:v0.8.6
image: earthly/earthly:v0.8.12

before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
Expand Down
4 changes: 2 additions & 2 deletions docs/ci-integration/guides/google-cloud-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Running this build will use the [`cloudbuild.yaml`](https://github.com/earthly/c

```yaml
- id: 'build'
name: 'earthly/earthly:v0.8.6'
name: 'earthly/earthly:v0.8.12'
args:
- --ci
- --push
Expand All @@ -117,7 +117,7 @@ Running this build will use the [`cloudbuild.yaml`](https://github.com/earthly/c
```yaml
- id: 'gcp-test'
name: 'earthly/earthly:v0.8.6'
name: 'earthly/earthly:v0.8.12'
args:
- +gcp-cloudbuild
secretEnv:
Expand Down
2 changes: 1 addition & 1 deletion docs/ci-integration/guides/woodpecker-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The project needs to be [trusted](https://woodpecker-ci.org/docs/usage/project-s
#.woodpecker.yml
pipeline:
earthly:
image: earthly/earthly:v0.8.6
image: earthly/earthly:v0.8.12
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
Expand Down
2 changes: 1 addition & 1 deletion docs/ci-integration/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Once you have ensured that the dependencies are available, you'll need to instal
This is the simplest method for adding `earthly` to your CI. It will work best on dedicated computers, or in scripted/auto-provisioned build environments. You can pin it to a specific version like so:

```shell
wget https://github.com/earthly/earthly/releases/download/v0.8.6/earthly-linux-amd64 -O /usr/local/bin/earthly && \
wget https://github.com/earthly/earthly/releases/download/v0.8.12/earthly-linux-amd64 -O /usr/local/bin/earthly && \
chmod +x /usr/local/bin/earthly && \
/usr/local/bin/earthly bootstrap
```
Expand Down
6 changes: 3 additions & 3 deletions docs/ci-integration/use-earthly-ci-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ For more details on using remote execution, [see our guide on remote BuildKit](.
The image expects the source code of the application you are building in the current working directory (by default `/workspace`). You will need to copy or mount the necessary files to that directory prior to invoking the entrypoint.

```bash
docker run --privileged --rm -v "$PWD":/workspace earthly/earthly:v0.8.6 +my-target
docker run --privileged --rm -v "$PWD":/workspace earthly/earthly:v0.8.12 +my-target
```

Or, if you would like to use an alternative directory:

```bash
docker run --privileged --rm -v "$PWD":/my-dir -w /my-dir earthly/earthly:v0.8.6 +my-target
docker run --privileged --rm -v "$PWD":/my-dir -w /my-dir earthly/earthly:v0.8.12 +my-target
```

Alternatively, you may rely on Earthly to perform a git clone, by using the remote target reference format. For example:

```bash
docker run --privileged --rm earthly/earthly:v0.8.6 github.com/foo/bar:my-branch+target
docker run --privileged --rm earthly/earthly:v0.8.12 github.com/foo/bar:my-branch+target
```

#### `NO_BUILDKIT` Environment Variable
Expand Down
18 changes: 9 additions & 9 deletions docs/cloud/satellites/gha-runners.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Satellites as GitHub Actions runners

{% hint style='warning' %}
This feature is experimental.
This feature is experimental.

Not recommended for production usage since it might introduce breaking changes in the future.
Not recommended for production usage since it might introduce breaking changes in the future.

Feedback is welcome and much appreciated!

Expand All @@ -24,19 +24,19 @@ The integration process requires you to provide us with a GitHub token, so we ca
Follow the next steps to create such integrations:

### 1. Create a GitHub token
Both GitHub classic and fine-grained tokens are supported, but depending on the type of installation (organization-wide or single-repository), the provided token requires different scopes:
Both GitHub classic and fine-grained tokens are supported, but depending on the type of installation (organization-wide or single-repository), the provided token requires different scopes:

| Integration type | User type | Classic token scopes | Fine-grained token permissions |
|------------------|--------------------|-------------------------------|----------------------------------------------------------------------|
| Organization | Organization admin | `admin:org_hook`, `admin:org` | `organization_hooks:write`, `organization_self_hosted_runners:write` |
| Repository | Repository admin | `admin:repo_hook`, `repo` | `repository_hooks:write`, `administration:write` |

{% hint style='info' %}
Follow the [official docs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) for detailed information on how to create a GitHub token, and make sure to set an expiration long enough, since the integration won't work after the token expires.
Follow the [official docs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) for detailed information on how to create a GitHub token, and make sure to set an expiration long enough, since the integration won't work after the token expires.
{% endhint %}

### 2. Register the integration via CLI
Create the integration using the `earthly github add` CLI command, passing the token created in the previous step.
Create the integration using the `earthly github add` CLI command, passing the token created in the previous step.

#### Organization integration
```
Expand All @@ -55,7 +55,7 @@ earthly github add \
--gh-token <github_token>
```

### 3. Configure your satellites
### 3. Configure your satellites

This feature needs to be enabled during satellite creation to be able to use it.

Expand Down Expand Up @@ -86,14 +86,14 @@ docker run --privileged \
-e SATELLITE_NAME=<satellite-name> \
-e SATELLITE_HOST=<satellite-host> \
-e RUNNER_GHA_ENABLED=true \
earthly/satellite:v0.8.11
earthly/satellite:v0.8.12
```
{% hint style='info' %}
**Required version:** Use at least `earthly/satellite:v0.8.11`
**Required version:** Use at least `earthly/satellite:v0.8.12`
{% endhint %}

##### Logs
You should see a log message like this, when the GitHub Actions runner is enabled:
You should see a log message like this, when the GitHub Actions runner is enabled:
```
{...,"msg":"starting GitHub Actions job polling loop",...}
```
Expand Down
8 changes: 4 additions & 4 deletions docs/cloud/satellites/self-hosted.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ docker run --privileged \
-e EARTHLY_ORG=my-org \
-e SATELLITE_NAME=my-satellite \
-e SATELLITE_HOST=153.65.8.0 \
earthly/satellite:v0.8.6
earthly/satellite:v0.8.12
```

The following environment variables are required:
Expand Down Expand Up @@ -107,7 +107,7 @@ runcmd:
-e EARTHLY_TOKEN=GuFna*****nve7e \
-e EARTHLY_ORG=my-org \
-e SATELLITE_NAME=my-satellite \
earthly/satellite:v0.8.6
earthly/satellite:v0.8.12
```
Note that the `SATELLITE_HOST` variable is unset in this example so that the host is auto-discovered by the satellite when it starts. This should result in the instance’s private DNS being used as the host.
Expand All @@ -134,7 +134,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
image: earthly/satellite:v0.8.6
image: earthly/satellite:v0.8.12
securityContext:
privileged: true
ports:
Expand Down Expand Up @@ -174,7 +174,7 @@ Here’s an example of how to attach the volume using the Docker command line:
```
docker run -v earthly-cache:/tmp/earthly:rw \
...
earthly/satellite:v0.8.6
earthly/satellite:v0.8.12
```

## Additional Environment Variables
Expand Down
12 changes: 6 additions & 6 deletions docs/docker-images/all-in-one.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ This image contains `earthly`, `buildkit`, and some extra configuration to enabl

## Tags

Currently, the `latest` tag is `v0.8.6`.
Currently, the `latest` tag is `v0.8.12`.
For other available tags, please check out https://hub.docker.com/r/earthly/earthly/tags

## Quickstart
Expand All @@ -14,7 +14,7 @@ Want to get started? Here are a couple sample `docker run` commands that cover t
This example shows how to use the Earthly container in conjunction with a Docker socket that Earthly can use to start up the BuildKit daemon.

```bash
docker run -t -v $(pwd):/workspace -v /var/run/docker.sock:/var/run/docker.sock -e NO_BUILDKIT=1 earthly/earthly:v0.8.6 +for-linux
docker run -t -v $(pwd):/workspace -v /var/run/docker.sock:/var/run/docker.sock -e NO_BUILDKIT=1 earthly/earthly:v0.8.12 +for-linux
```

Here's a quick breakdown:
Expand All @@ -30,7 +30,7 @@ Here's a quick breakdown:
This example shows how the Earthly image can start a BuildKit daemon within the same container. A Docker socket is not needed in this case, however the container will need to be run with the `--privileged` flag.

```bash
docker run --privileged -t -v $(pwd):/workspace -v earthly-tmp:/tmp/earthly:rw earthly/earthly:v0.8.6 +for-linux
docker run --privileged -t -v $(pwd):/workspace -v earthly-tmp:/tmp/earthly:rw earthly/earthly:v0.8.12 +for-linux
```

Here's a quick breakdown:
Expand All @@ -46,7 +46,7 @@ Here's a quick breakdown:
This example utilizes an [Earthly Satellite](https://docs.earthly.dev/earthly-cloud/satellites) to perform builds. The code to be built is downloaded directly from GitHub.

```bash
docker run -t -e NO_BUILDKIT=1 -e EARTHLY_TOKEN=<my-token> earthly/earthly:v0.8.6 --ci --org <my-org> --sat <my-sat> github.com/earthly/earthly+for-linux
docker run -t -e NO_BUILDKIT=1 -e EARTHLY_TOKEN=<my-token> earthly/earthly:v0.8.12 --ci --org <my-org> --sat <my-sat> github.com/earthly/earthly+for-linux
```

Here's what this does:
Expand All @@ -61,11 +61,11 @@ Here's what this does:
This example shows how to use the Earthly container to run non-build commands. This is useful for running commands like `earthly account`, or `earthly secret`.

```bash
docker run -t -e NO_BUILDKIT=1 -e EARTHLY_TOKEN=<my-token> earthly/earthly:v0.8.6 account list-tokens
docker run -t -e NO_BUILDKIT=1 -e EARTHLY_TOKEN=<my-token> earthly/earthly:v0.8.12 account list-tokens
```

```bash
docker run -t -e NO_BUILDKIT=1 -e EARTHLY_TOKEN=<my-token> earthly/earthly:v0.8.6 secret get foo
docker run -t -e NO_BUILDKIT=1 -e EARTHLY_TOKEN=<my-token> earthly/earthly:v0.8.12 secret get foo
```

## Using This Image
Expand Down
2 changes: 1 addition & 1 deletion docs/docker-images/buildkit-standalone.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This image contains `buildkit` with some Earthly-specific setup. This is what Ea

## Tags

Currently, the `latest` tag is `v0.8.6`.
Currently, the `latest` tag is `v0.8.12`.
For other available tags, please check out https://hub.docker.com/r/earthly/buildkitd/tags

## Quickstart
Expand Down
Loading

0 comments on commit 3755bcb

Please sign in to comment.