Git Product home page Git Product logo

docker-nexus's Introduction

docker-nexus

A container image for Sonatype Nexus Repository Manager OSS, based on Alpine Linux.

Docker Repository on Quay

Current software

  • Alpine Linux 3.14
  • OpenJDK JRE 8u212
  • Nexus Repository Manager OSS 3.42.0 (release notes)

Running

Running it locally (for the latest tag, check quay.io/repository/travelaudience/docker-nexus:

docker run -p 8081:8081 --name nexus quay.io/travelaudience/docker-nexus:3.42.0-01

Reasoning

The Official Sonatype Nexus Docker image: https://hub.docker.com/r/sonatype/nexus3/ is suitable for most use cases. But as discussed in this blog post: https://www.sonatype.com/travel-audience-devops-pipeline-solution being able to restore from a backup requires stopping the nexus service. And this is not possible with the official image, as described in this bug report: https://issues.sonatype.org/browse/NEXUS-23442

So while travel audience would prefer to support the official image, this is not possible at this time, and we hope that this lightweight image provides a suitable alternative to the community in the meantime.

The travel audience Nexus Docker image provides the following features that are not present in the official image:

  • uses runit to run nexus under a secondary process
  • uses an Alpine base image, instead of RedHat's UBI8
  • provides an optional flag to make sure all mounted data is owned by the nexus user (nexus will have issues if that's not the case)

docker-nexus's People

Contributors

abdennour avatar adrianokf avatar bbriggs avatar bmcustodio avatar caarlos0 avatar cmoroianu1 avatar dmitriystoyanov avatar halynazibina avatar johnheusinger avatar macskay avatar max-k avatar pascal-hofmann avatar penguincoder avatar pg2000 avatar pires avatar samuelb avatar vitaliyf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-nexus's Issues

Timeout chown /nexus-data

Hey,

we're running this image in a K8s cluster. We already have >250GB data and this leads to a problem that the 2nd line in the run script (the chown of the /nexus-data) takes ages or even hangs. Then K8s thinks that the pod is not ready in time and will reschedule it.

We could increase the timeout but this is a dirty quickfix that doesn't scale.

An idea is to control the chown line via an ENV variable. So for example
CHOWN_NEXUS_DATA=true could be the default and could be overridden if the chown thing is not needed.

Imho this command should only be run for initial startup and not necessarily on each startup since the files are already owned by the nexus user.

If you agree i could also add a PR for this.

please release new version to quay.io

docker pull quay.io/travelaudience/docker-nexus:3.30.1
Error response from daemon: manifest for quay.io/travelaudience/docker-nexus:3.30.1 not found: manifest unknown: manifest unknown

latest available 3.31.1 (official)

latest available in quay.io is 3.29.2 (6 month ago)

it's important as 3.29.2 contains critical vulnerabilities

Runsvdir downside

Hi,

The usage of runsvdir is usefull to being able to restore from a backup but prevent gracefull stop of his childs processes when you try to stop the container.

The docker stop command attempts to stop a running container first by sending a SIGTERM signal to the root process (PID 1) in the container.

If runsvdir receives a TERM signal, it exits with 0 immediately (https://www.unix.com/man-page/centos/8/runsvdir/)

The aftermath of this : you can't gracefully stop nexus when you do any of this actions , because every of this commands send SIGTERM to the root process(runsvdir) :

  • kubectl delete
  • kubectl scale statefulset --replicas=0
  • helm delete
  • docker stop

Best regards.

Update to Nexus 3.26.1

3.26 introduces an import/export capability to Nexus (https://issues.sonatype.org/browse/NEXUS-11468) that would be nice to have. If you want, I can submit a PR to update the Dockerfile for the new version, but I don't know anything about your official process for releasing a new version or testing guidelines. Thanks.

Nexus slow start large cache repository

chown -R nexus:nexus /nexus-data

Hi,

Could you explain why we are doing a change owner here on the folder /nexus-data ?
We have more than 15K packages in a cache repo, and we need almost 20 minutes to start the container/service.

Thank you.

Remove MaxDirectMemorySize from nexus.vmoptions?

Is there any reason why -XX:MaxDirectMemorySize=2703m is not removed from ${NEXUS_HOME}/bin/nexus.vmoptions?

If I set MaxDirectMemorySize in environment variable INSTALL4J_ADD_VM_PARAMS it will be overwritten by the setting from nexus.vmoptions.

Run as non-root

travelaudience/docker-nexus is developed to not run as a certain user. So it will run as UID 0. This is not preferred in case of security. Maybe there's a chance for a change in further versions?
Thanks
Markus

An elegant way to install bundle

I am looking for a way to install other bundles into the docker image. Besides extending the base image and do some copy and update features.xml file, do we have another way to do it?

Update logback.xml to include additional loggers

The default logback.xml https://github.com/sonatype/nexus-public/blob/master/assemblies/nexus-base-template/src/main/resources/overlay/etc/logback/logback.xml has additional loggers.

These tasklogfile logger block are needed for the Admin clean up tasks added as part of release 3.14.0

2019-07-26 09:51:36,536+0000 INFO  [qtp1610238176-40] admin org.sonatype.nexus.quartz.internal.task.QuartzTaskInfo - Task 'Cleanup service' [repository.cleanup] state change WAITING -> RUNNING
2019-07-26 09:51:36,574+0000 INFO  [quartz-3-thread-6] *SYSTEM org.sonatype.nexus.cleanup.internal.task.CleanupTask - Task information:
2019-07-26 09:51:36,574+0000 INFO  [quartz-3-thread-6] *SYSTEM org.sonatype.nexus.cleanup.internal.task.CleanupTask -  ID: d817a286-5f39-4136-a696-afaffba11a43
2019-07-26 09:51:36,574+0000 INFO  [quartz-3-thread-6] *SYSTEM org.sonatype.nexus.cleanup.internal.task.CleanupTask -  Type: repository.cleanup
2019-07-26 09:51:36,574+0000 INFO  [quartz-3-thread-6] *SYSTEM org.sonatype.nexus.cleanup.internal.task.CleanupTask -  Name: Cleanup service
2019-07-26 09:51:36,574+0000 INFO  [quartz-3-thread-6] *SYSTEM org.sonatype.nexus.cleanup.internal.task.CleanupTask -  Description: Run repository cleanup
2019-07-26 09:51:36,575+0000 ERROR [quartz-3-thread-6] *SYSTEM org.sonatype.nexus.logging.task.TaskLogHome - Could not find a Logback SiftingAppender named 'tasklogfile' in the logback configuration. Please check that the 'tasklogfile' appender exists in logback.xml
2019-07-26 09:51:36,575+0000 INFO  [quartz-3-thread-6] *SYSTEM org.sonatype.nexus.cleanup.internal.task.CleanupTask - Starting cleanup
2019-07-26 09:51:36,623+0000 ERROR [quartz-3-thread-6] *SYSTEM org.sonatype.nexus.cleanup.internal.task.CleanupTask - Failed to run task 'Run repository cleanup'
java.lang.NullPointerException: null
    at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:882)
    at org.sonatype.nexus.cleanup.internal.storage.orient.OrientCleanupPolicyEntityAdapter.get(OrientCleanupPolicyEntityAdapter.java:133)
    at org.sonatype.nexus.cleanup.internal.storage.orient.OrientCleanupPolicyStorage.lambda$3(OrientCleanupPolicyStorage.java:95)
    at org.sonatype.nexus.orient.transaction.OrientOperations.lambda$1(OrientOperations.java:56)
    at org.sonatype.nexus.transaction.OperationPoint.proceed(OperationPoint.java:64)
    at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:56)
    at org.sonatype.nexus.transaction.Operations.transactional(Operations.java:200)
    at org.sonatype.nexus.transaction.Operations.call(Operations.java:146)

Available CPUs: always 1

It seems that Nexus is unable to detect the right amount of CPUs/Cores.
Before I file a bug upstream, can you please verify that your set up shows the same?
I regularly need bulk delete of blob objects and doing so is always very slow.

Update/publish version >=3.25.1?

Currently using latest which is 3.23 and encountering the following:

This version of Nexus Repository Manager is vulnerable to a critical remote code execution security vulnerability.

We recommend immediate upgrade to 3.25.1 or later, especially if this is a public instance.

I'm happy to do a PR and update the Dockerfile if that helps.

P.S. thanks for publishing this image - great help! :)

nexus cluster in k8s

Hi!
We try to run nexus cluster in k8s. We use helm-chart oteemocharts/sonatype-nexus 4.0.0 and image quay.io/travelaudience/docker-nexus:3.25.1

In hazelcast documentation we found info about following plugin
https://github.com/hazelcast/hazelcast-kubernetes

Does image quay.io/travelaudience/docker-nexus already include thit plugin for working with kubernetes?
Thank you.

base image problem

Appreciate you did it with extra feature for production enviroinment.

it is not problem, it is just a culture and policy in the compay. We are not allowed to use alpine as base image for any production applications.

We can run some tools using alpine image for a quick job, but not running application.

Could you give me some hints, if it is possible:

I want to use exist official nexus docker image and add the extra feature as you mentioned in this repo (uses runit to run nexus under a secondary process)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.