Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@

# Git version is dynamically generated
airflow/git_version
airflow/ui/node_modules
airflow/auth/managers/simple/ui/node_modules

# Exclude node/pmpme caches..
**/.pnpm-store
**/node_modules
# Exclude link to docs
airflow/ui/static/docs

Expand All @@ -91,6 +92,14 @@ airflow/www/static/docs
airflow/www/static/dist
airflow/www/node_modules

# Exclude any .venv and .ruff_cache
**/.venv
**/.ruff_cache/

# Exclude docs artifacts
**/_inventory_cache/
docs/**/_api/**

# Exclude python generated files
**/__pycache__/
**/*.py[cod]
Expand All @@ -99,7 +108,7 @@ airflow/www/node_modules
**/env/
**/build/
**/develop-eggs/
/dist/
**/dist/
**/downloads/
**/eggs/
**/.eggs/
Expand Down
26 changes: 26 additions & 0 deletions dev/MANUALLY_BUILDING_IMAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [Building docker images](#building-docker-images)
- [Keeping your docker context small](#keeping-your-docker-context-small)
- [Setting environment with emulation](#setting-environment-with-emulation)
- [Setting up cache refreshing with hardware ARM/AMD support](#setting-up-cache-refreshing-with-hardware-armamd-support)

Expand All @@ -37,6 +38,31 @@ you do not have those two installed.
You also need to have the right permissions to push the images, so you should run
`docker login` before and authenticate with your DockerHub token.

## Keeping your docker context small

Sometimes, especially when you generate node assets, some of the files generated are kept in the source
directory. This can make the docker context very large when building images, because the whole context
is transferred to the docker daemon. In order to avoid this we have .dockerignore where we exclude certain
paths from being treated as part of the context - similar to .gitignore that keeps them away from git.

If your context gets large you see a long (minutes) preliminary step before dockeer build is run
where the context is being transmitted.

You can see all the context files by running:

```shell script
printf 'FROM scratch\nCOPY . /' | DOCKER_BUILDKIT=1 docker build -q -f- -o- . | tar t
```

Once you see something that should be excluded from the context, you should add it to `.dockerignore` file.

You can also check the size of the context by running:

```shell script
printf 'FROM scratch\nCOPY . /' | DOCKER_BUILDKIT=1 docker build -q -f- -o- . | wc -c | numfmt --to=iec --suffix=B
```


## Setting environment with emulation

According to the [official installation instructions](https://docs.docker.com/buildx/working-with-buildx/#build-multi-platform-images)
Expand Down