Search code examples
dockerdocker-composenexus3

Nexus repository manager docker upgrade


I am trying to upgrade a NXRM3 repository which is running on a docker container with a persistent volume attached to it. The existing docker container is a custom built image by adding couple of plugins through Dockerfile. I want to build the latest version image with those newer version plugins and run NXRM3 on the updated version, but how do i use the same volume with the new container? Can i attach the volume to the new container and does that work? Any help regarding the safest process is much appreciated. Thanks in advance.

Below is the docker-compose file for the existing version:

services:
 nexus:
   container_name: nexus
   build: .
   ports:
     - "8080:8080"
     - "8081:8081"
     - "8082:8082"
   volumes:
     - "nexus-data:/nexus-data"
   restart: unless-stopped
volumes:
 nexus-data:

Solution

  • The volume exists independently of the container. So just create the new image and create a new container based on it with the original volume attached. To be completely on the safe side you can make a backup of the volume.

    In case you keep the images in Nexus as well, be careful to have it available on the host before you bring down the old Nexus container.