Skip to content

Commit f4f46c3

Browse files
docs: add docs for how to create a working docker image (#60898)
Co-authored-by: David Gold <[email protected]>
1 parent 147a23a commit f4f46c3

File tree

5 files changed

+78
-10
lines changed

5 files changed

+78
-10
lines changed

docs/integrations/custom-connectors.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,16 @@ It's easy to build your own connectors for Airbyte. You can learn how to build n
2525
While the guides in the link above are specific to the languages used most frequently to write integrations, **Airbyte connectors can be written in any language**. Please reach out to us if you'd like help developing connectors in other languages.
2626

2727
:::caution
28-
If you don't use one of the official development options, remember to set the `AIRBYTE_ENTRYPOINT` environment variable to your Docker image's entrypoint!
29-
Otherwise, your connector will not run correctly.
30-
:::
28+
We strongly recommend creating new connectors using the [Connector Builder](https://docs.airbyte.com/connector-development/connector-builder-ui/overview) or one of the Airbyte CDKs.
29+
30+
While it is not recommended to build Docker images from scratch, it can be useful to build a custom Docker image if you cannot use the Connector Builder, and if you need to use a language other than Python or CDK.
31+
32+
See the following guides for more information on building custom Airbyte Docker images:
3133

32-
Learn how to upload Docker-based custom connectors [here](../../platform/operator-guides/using-custom-connectors/)
34+
- [Using Custom Connectors](../platform/operator-guides/using-custom-connectors)
35+
- [Airbyte Docker Protocol](../platform/understanding-airbyte/airbyte-protocol-docker)
36+
37+
:::
3338

3439
## Upgrading a connector
3540

docs/platform/operator-guides/using-custom-connectors.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ To push and pull images to your private Docker registry, you need to authenticat
3636
- Your local or CI environment (where you build your connector image) must be able to **push** images to your registry.
3737
- Your Airbyte instance must be able to **pull** images from your registry.
3838

39+
## 3. Adhere to Airbyte's Docker Image Requirements
40+
41+
See the [Airbyte Protocol Docker Interface](../understanding-airbyte/airbyte-protocol-docker.md) page for specific Docker image requirements, such as required environment variables.
42+
3943
### For Docker-compose Airbyte deployments
4044

4145
#### On GCP - Artifact Registry:
@@ -107,21 +111,24 @@ You can pull your connector image from your private registry to validate the pre
107111

108112
5. `Add` the connector to save the configuration. You can now select your new connector when setting up a new connection!
109113

110-
111114
# Troubleshooting
112115

113116
## Loading connector docker containers into kind
117+
114118
If you are running Airbyte in kind (kubernetes in docker -- this is the default method for abctl), you must load the docker image of that connector into the cluster. If you are seeing the following error, it likely means that the docker image has not been properly loaded into the cluster.
115119

116120
![Screenshot of UI error when custom connector container is not loaded in the cluster](./assets/custom-connector-error1.png)
117121

118122
![Screenshot of K8s error when custom connector container is not loaded in the cluster](./assets/custom-connector-error2.png)
119123

120124
A connector container can be loaded using the following command:
121-
```
125+
126+
```bash
122127
kind load docker-image <image-name>:<image-tag> -n airbyte-abctl
123128
```
129+
124130
For the example above, the command would be:
125-
```
131+
132+
```bash
126133
kind load docker-image airbyte/source-custom:1 -n airbyte-abctl
127134
```

docs/platform/understanding-airbyte/airbyte-protocol-docker.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,29 @@ The `write` command will consume `AirbyteMessage`s from STDIN.
5151
- Connectors receive arguments on the command line via JSON files. `e.g. --catalog catalog.json`
5252
- They read `AirbyteMessage`s from STDIN. The destination `write` action is the only command that consumes `AirbyteMessage`s.
5353
- They emit `AirbyteMessage`s on STDOUT.
54+
55+
## Additional Docker Image Requirements
56+
57+
### Environment variable: `AIRBYTE_ENTRYPOINT`
58+
59+
The Docker image must contain an environment variable called `AIRBYTE_ENTRYPOINT`. This must be the same as the `ENTRYPOINT` of the image.
60+
61+
## Non-Root User: `airbyte`
62+
63+
The Docker image should run under a user named `airbyte`.
64+
65+
## Specified `/airbyte` directory
66+
67+
The Docker image must have a directory called `/airbyte`, which the user `airbyte` owns and can write to.
68+
69+
This is the directory to which temporary files will be mounted, including the `config.json` and `catalog.json` files.
70+
71+
## Only write file artifacts to directories permitted by the base image
72+
73+
The connector code must only write to directories permitted within the connector's base image.
74+
75+
For a list of permitted write directories, please consult the base image definitions in the [`airbytehq/airbyte` repo](https://github.com/airbytehq/airbyte), under the [`docker-images` directory](https://github.com/airbytehq/airbyte/tree/master/docker-images).
76+
77+
## Must be an `amd64` or multi-arch image
78+
79+
To run on Airbyte Platform, the image bust be valid for `amd64`. Since most developers contribute from (ARM-based) Mac M-series laptops, we recommend creating a multi-arch image that covers both `arm64/amd64` so that the same image tags work on both ARM and AMD runtimes.

docusaurus/platform_versioned_docs/version-1.6/operator-guides/using-custom-connectors.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ products: oss-*
33
sidebar_label: Uploading custom connectors
44
---
55

6-
import ContainerProviders from '@site/static/\_docker_image_registries.md';
6+
import ContainerProviders from '@site/static/_docker_image_registries.md';
77

88
# Uploading Docker-based custom connectors
99

@@ -36,6 +36,10 @@ To push and pull images to your private Docker registry, you need to authenticat
3636
- Your local or CI environment (where you build your connector image) must be able to **push** images to your registry.
3737
- Your Airbyte instance must be able to **pull** images from your registry.
3838

39+
## 3. Adhere to Airbyte's Docker Image Requirements
40+
41+
See the [Airbyte Protocol Docker Interface](../understanding-airbyte/airbyte-protocol-docker.md) page for specific Docker image requirements, such as required environment variables.
42+
3943
### For Docker-compose Airbyte deployments
4044

4145
#### On GCP - Artifact Registry:
@@ -119,12 +123,12 @@ If you are running Airbyte in kind (kubernetes in docker -- this is the default
119123

120124
A connector container can be loaded using the following command:
121125

122-
```
126+
```bash
123127
kind load docker-image <image-name>:<image-tag> -n airbyte-abctl
124128
```
125129

126130
For the example above, the command would be:
127131

128-
```
132+
```bash
129133
kind load docker-image airbyte/source-custom:1 -n airbyte-abctl
130134
```

docusaurus/platform_versioned_docs/version-1.6/understanding-airbyte/airbyte-protocol-docker.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,29 @@ The `write` command will consume `AirbyteMessage`s from STDIN.
5151
- Connectors receive arguments on the command line via JSON files. `e.g. --catalog catalog.json`
5252
- They read `AirbyteMessage`s from STDIN. The destination `write` action is the only command that consumes `AirbyteMessage`s.
5353
- They emit `AirbyteMessage`s on STDOUT.
54+
55+
## Additional Docker Image Requirements
56+
57+
### Environment variable: `AIRBYTE_ENTRYPOINT`
58+
59+
The Docker image must contain an environment variable called `AIRBYTE_ENTRYPOINT`. This must be the same as the `ENTRYPOINT` of the image.
60+
61+
## Non-Root User: `airbyte`
62+
63+
The Docker image should run under a user named `airbyte`.
64+
65+
## Specified `/airbyte` directory
66+
67+
The Docker image must have a directory called `/airbyte`, which the user `airbyte` owns and can write to.
68+
69+
This is the directory to which temporary files will be mounted, including the `config.json` and `catalog.json` files.
70+
71+
## Only write file artifacts to directories permitted by the base image
72+
73+
The connector code must only write only to directories permitted within the connector's base image.
74+
75+
For a list of permitted write directories, please consult the base image definitions in the [`airbytehq/airbyte` repo](https://github.com/airbytehq/airbyte), under the [`docker-images` directory](https://github.com/airbytehq/airbyte/tree/master/docker-images).
76+
77+
## Must be an `amd64` or multi-arch image
78+
79+
To run on Airbyte Platform, the image bust be valid for `amd64`. Since most developers contribute from (ARM-based) Mac M-series laptops, we recommend creating a multi-arch image that covers both `arm64/amd64` so that the same image tags work on both ARM and AMD runtimes.

0 commit comments

Comments
 (0)