containers: Make config path configurable
Container configuration directory can be set in the .env file which is automatically used by docker-compose. The default value is the one used previously (containers/config). The HACKING.md guide is updated to describe how to set this and how it affects other commands.
This commit is contained in:
parent
4b1581a71c
commit
14183ba10a
3 changed files with 23 additions and 5 deletions
23
HACKING.md
23
HACKING.md
|
|
@ -52,20 +52,37 @@ containers. Building and starting containers is generally faster than building
|
|||
RPMs and installing them in a VM, so this method is more convenient for
|
||||
developing and testing changes quickly.
|
||||
|
||||
### Configuration
|
||||
|
||||
Each service (*composer* and *worker*) requires a configuration file and a set
|
||||
of certificates. Use the [`tools/gen-certs.sh`](./tools/gen-certs.sh) script to
|
||||
of certificates. The storage location for these is shared between the
|
||||
containers for simplicity. By default it's configured to be at
|
||||
`./containers/config`, but this can be changed in the
|
||||
[`./distribution/.env`](./distribution/.env) file by modifying the value of the
|
||||
`$CONTAIN£R_CONFIG_DIR` variable (both absolute and relative paths work).
|
||||
|
||||
Use the [`tools/gen-certs.sh`](./tools/gen-certs.sh) script to
|
||||
generate the certificates (using the test OpenSSL config file):
|
||||
|
||||
./tools/gen-certs.sh ./test/data/x509/openssl.cnf ./containers/config ./containers/config/ca
|
||||
|
||||
The services also require a config file (each) which they expect to be in the
|
||||
Note that the two arguments `./containers/config` and `./containers/config/ca`
|
||||
should be the same location as the `$CONTAINER_CONFIG_DIR` described above
|
||||
|
||||
The services also require a config file each which they expect to be in the
|
||||
same directory. The following test files can be copied into it:
|
||||
|
||||
cp ./test/data/composer/osbuild-composer.toml ./test/data/composer/osbuild-worker.toml ./containers/config/
|
||||
|
||||
The `containers/config` directory will be mounted inside both containers (see
|
||||
The `$CONTAINER_CONFIG_DIR` (default `containers/config`) directory will be mounted inside both containers (see
|
||||
the [`docker-composer.yml`](./distribution/docker-compose.yml) file).
|
||||
|
||||
### Build and run
|
||||
|
||||
To build the containers, change into the `distribution/` directory and run:
|
||||
|
||||
docker-compose build
|
||||
|
||||
To start the containers, change into the `distribution/` directory and run:
|
||||
|
||||
docker-compose up
|
||||
|
|
|
|||
|
|
@ -1 +1,2 @@
|
|||
COMPOSE_PROJECT_NAME=osbuild
|
||||
CONTAINER_CONFIG_DIR=../containers/config
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ services:
|
|||
context: ..
|
||||
dockerfile: ./distribution/Dockerfile-ubi
|
||||
volumes:
|
||||
- ../containers/config:/etc/osbuild-composer
|
||||
- ${CONTAINER_CONFIG_DIR}/:/etc/osbuild-composer
|
||||
networks:
|
||||
net:
|
||||
ipv4_address: 172.30.0.10
|
||||
|
|
@ -18,7 +18,7 @@ services:
|
|||
# override the entrypoint to specify composer hostname and port
|
||||
entrypoint: /usr/libexec/osbuild-composer/osbuild-worker composer:8700
|
||||
volumes:
|
||||
- ../containers/config:/etc/osbuild-composer
|
||||
- ${CONTAINER_CONFIG_DIR}/:/etc/osbuild-composer
|
||||
environment:
|
||||
- CACHE_DIRECTORY=/var/cache/osbuild-worker
|
||||
privileged: true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue