4ndrew
4ndrew

Reputation: 11

Nexus repository configuration with dockerization

Is it possible to configure Nexus repository manager (3.9.0) in a way which is suitable for a Docker based containerized environment?

We need a customized docker image which contains basic configurations for the nexus repository manager, like project specific repositories, LDAP based authentication for users. We found that most of the nexus configurations live in the database (OrientDB) used by nexus. We also found that there is a REST interface offered by nexus to handle configurations by 3rd parties, but we found no configuration exporter/importer capabilites besides backup (directory servers ha LDIF, application servers ha command line scripts, etc.).

Right now we export the configuration as backup files, and during the customized docker image build we copy those backup file back to the file system in the container:

FROM sonatype/nexus3:latest

[...]

# Copy backup files
COPY backup/* ${NEXUS_DATA}/backup/

When the conatiner starts up it will pick up the backup files and the nexus will be configured the way we need. However though, it would be much better if there was a way which would allow us the handle these configurations via a set of config files.

Upvotes: 0

Views: 1636

Answers (1)

Dawid Sawa
Dawid Sawa

Reputation: 2194

All that data is stored under /nexus-data, so you can create an initial docker container with a docker volume or a host directory that would keep all that data. After you preconfigured that instance you can distribute your customized docker image with that docker volume containing nexus data. Or if you used a host directory you can simply copy over all that data is similar fashion as you do now, but use /nexus-data directory instead.

You can find more information at DockerHub under Persistent Data.

Upvotes: 3

Related Questions