Skip to content

Commit 6fc26e4

Browse files
sobolkjosefaidt
andauthored
Describe docker support state (#8206)
* Describe docker support state * amazonlinux * Update src/pages/[platform]/build-a-backend/functions/custom-functions/index.mdx Co-authored-by: josef <[email protected]> * Update src/pages/[platform]/build-a-backend/functions/custom-functions/index.mdx Co-authored-by: josef <[email protected]> --------- Co-authored-by: josef <[email protected]>
1 parent f8190a5 commit 6fc26e4

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"amazonaws",
6969
"amazonaws",
7070
"amazoncognito",
71+
"amazonlinux",
7172
"AmazonPersonalizeProvider",
7273
"AmazonS3Client",
7374
"Amplif",

src/pages/[platform]/build-a-backend/functions/custom-functions/index.mdx

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ AWS Amplify Gen 2 functions are AWS Lambda functions that can be used to perform
3434

3535
<Callout warning>
3636

37-
**Note:** [Fullstack Git-based environments](https://docs.amplify.aws/react/how-amplify-works/concepts/#fullstack-git-based-environments) do not support Docker for functions bundling out of the box.
37+
**Note:** [Fullstack Git-based environments](https://docs.amplify.aws/react/how-amplify-works/concepts/#fullstack-git-based-environments) do not support Docker for functions bundling out of the box. To learn more [skip to the Docker section](#Docker).
3838

3939
</Callout>
4040

@@ -81,7 +81,7 @@ Next, create the corresponding handler file at `amplify/functions/say-hello/inde
8181

8282
```ts title="amplify/functions/say-hello/index.py"
8383
import json
84-
84+
8585
def handler(event, context):
8686
return {
8787
"statusCode": 200,
@@ -104,7 +104,7 @@ some-other-package>=1.0.0
104104
You're now ready to deploy your python function. Next is the same process as the Node.js/TypeScript function. Go to [Common steps for all languages](#common-steps-for-all-languages) to continue.
105105
106106
## Go
107-
To get started, Create a new directory and a resource file, `amplify/functions/say-hello/resource.ts`. Then, define the function with `defineFunction`:
107+
To get started, Create a new directory and a resource file, `amplify/functions/say-hello/resource.ts`. Then, define the function with `defineFunction`:
108108
109109
```ts title="amplify/functions/say-hello/resource.ts"
110110
import { execSync } from "node:child_process";
@@ -187,7 +187,7 @@ go mod tidy
187187

188188
You're now ready to deploy your golang function. Next is the same process as the Node.js/TypeScript function.
189189

190-
## Common steps for all languages
190+
## Common steps for all languages
191191

192192
Regardless of the language used, your function needs to be added to your backend.
193193
```ts title="amplify/backend.ts"
@@ -228,3 +228,20 @@ export const data = defineData({
228228
},
229229
})
230230
```
231+
232+
## Docker
233+
234+
Custom function may require [Docker](https://www.docker.com/) in order to build and bundle function's code. A deployment failing with `CustomFunctionProviderDockerError` error indicates that a custom function requires Docker but the Docker daemon was not found. In that case you need to provide a working Docker installation at runtime.
235+
236+
### Personal sandboxes
237+
238+
Ensure that Docker is installed on your computer and that Docker daemon is running. You can check if Docker daemon is running using the following command:
239+
```bash title="terminal" showLineNumbers={false}
240+
docker info
241+
```
242+
243+
### Fullstack Git-based environments
244+
245+
Amplify does not provide Docker daemon out of the box in branch deployments. However, you have an option to provide [your own image that meets Amplify requirements](https://docs.aws.amazon.com/amplify/latest/userguide/custom-build-image.html) and includes a Docker installation.
246+
247+
For example, the `aws/codebuild/amazonlinux-x86_64-standard:5.0` image ([see definition](https://github.com/aws/aws-codebuild-docker-images)) meets Amplify requirements and includes Docker installation.

0 commit comments

Comments
 (0)