elastic / elastic/docs-content

[REQUEST]: Include steps to customize packages for the Elastic Package Registry container

Open
#7,763 1 comment 0 reactions 0 assignees View on GitHub
good-for-ai Team:SKI
Dominant language
No language data
Stars
47
Forks
261
Avg merge
3d 12h
Merged PRs (30d)
116

Description

### Description

Sometimes it would be interesting to customize the packages available in the docker distribution images (e.g. docker.elastic.co/package-registry/distribution:9.0.1) to include other packages.

This is also interesting for air-gapped environments.

For instance, there could be some content packages that are not available in the current docker images or maybe it is needed to add custom built packages too.

The steps to follow would be the next ones:

1. Download all the required packages from Elastic Package Registry (https://epr.elastic.co) and their corresponding signatures into a new folder (e.g. packages). For instance:
```shell
mkdir -p packages
cd packages
wget "https://epr.elastic.co/epr/kubernetes_otel/kubernetes_otel-1.1.0.zip"
wget "https://epr.elastic.co/epr/kubernetes_otel/kubernetes_otel-1.1.0.zip.sig"
...
```
2. Get the current configuration of the docker distribution image:
```shell
# Current configuration
$ docker run --rm -it \
--entrypoint /bin/cat \
docker.elastic.co/package-registry/distribution:8.17.2 /package-registry/config.yml
package_paths:
- /packages/package-storage

cache_time.search: 1m
cache_time.categories: 10m
cache_time.catch_all: 10m
```
3. Based on that configuration, create a new configuration file `config.yml` adding a new path under `package_paths` key:
- Example adding `/packages/custom` folder (to be used as a volume mount in next step):
```shell
$ cat config.yml
package_paths:
- /packages/package-storage
- /packages/custom

cache_time.search: 1m
cache_time.categories: 10m
cache_time.catch_all: 10m
```
3. Finally, they should run the distribution docker mounting both the configuration file and the new folder with the packages (along with all the other needed parameters according to the [air-gapped docs](https://www.elastic.co/docs/reference/fleet/air-gapped#air-gapped-diy-epr))
- This would be a minimal example without any TLS or any other flags
```shell
docker run --rm -it \
-v ./config.yml:/package-registry/config.yml \
-v ./packages:/packages/custom \
docker.elastic.co/package-registry/distribution:9.0.1
```

### Resources

IIRC there are these docs about how to run Elastic Package Registry in air-gapped environments: https://www.elastic.co/docs/reference/fleet/air-gapped#air-gapped-diy-epr

I'm not sure if there would be other related docs.

### Collaboration

The product team will provide the initial content.

### Point of contact.

**Main contact:** @mrodm

**Stakeholders:** @elastic/ecosystem

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.