# Upgrade Nexus 3.6x.y to latest using docker-compose

**URL:** https://community.sonatype.com/t/upgrade-nexus-3-6x-y-to-latest-using-docker-compose/12013
**Category:** Sonatype Nexus Repository
**Tags:** docker, upgrade
**Created:** [February 5, 2024, 6:12pm UTC](https://community.sonatype.com/t/upgrade-nexus-3-6x-y-to-latest-using-docker-compose/12013 "2024-02-05T18:12:56Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![learnit.linux](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@learnit.linux](https://community.sonatype.com/u/learnit.linux)
#### Post date: [February 5, 2024, 6:12pm UTC](https://community.sonatype.com/t/upgrade-nexus-3-6x-y-to-latest-using-docker-compose/12013/1 "2024-02-05T18:12:56Z")

</div>

Hi,  
I could use some help here. I am upgrading a docker container for the first time and the nexus repo happens to be the first one. My goal is to upgrade from 3.60.0 to the latest image. I have copied my docker-compose file here.

```auto
version: "3.9"
services:
  nexus:
    # image: sonatype/nexus3:3.60.0
    image: sonatype/nexus3:latest
    container_name: nexus
    ports:
      - 8081:8081
    restart: always
    volumes:
      - "/data/nexus/:/nexus-data"
      - nexus-vol:/opt/sonatype
volumes:
    nexus-vol:

```

Now, the nexus container is already running with the 3.60.0 version. After changing the docker image to the latest as above. I executed the two commands below.  
$ docker-compose pull nexus  
$ docker-compose up -d

Though, the docker-compose shows it is using the latest image but the webpage is still showing the 3.60.0

$ docker-compose images nexus  
CONTAINER REPOSITORY TAG IMAGE ID SIZE  
nexus sonatype/nexus3 latest bda195cc2883 572MB

What else I should do to do a proper upgrade?

Thank you in advance,  
Bharath

---

<div class="post-metadata">

### Author: ![rseddon](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/rseddon/32/341_2.png) [@rseddon](https://community.sonatype.com/u/rseddon)
#### Post date: [February 5, 2024, 6:34pm UTC](https://community.sonatype.com/t/upgrade-nexus-3-6x-y-to-latest-using-docker-compose/12013/2 "2024-02-05T18:34:54Z")

</div>

Sometimes the version number is cached by web browsers. Have you tried clearing your browser’s cache?

---

<div class="post-metadata">

### Author: ![learnit.linux](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@learnit.linux](https://community.sonatype.com/u/learnit.linux)
#### Post date: [February 5, 2024, 7:01pm UTC](https://community.sonatype.com/t/upgrade-nexus-3-6x-y-to-latest-using-docker-compose/12013/3 "2024-02-05T19:01:46Z")

</div>

Did not help. I have also used a completely different browser.

---

<div class="post-metadata">

### Author: ![learnit.linux](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@learnit.linux](https://community.sonatype.com/u/learnit.linux)
#### Post date: [February 6, 2024, 12:29am UTC](https://community.sonatype.com/t/upgrade-nexus-3-6x-y-to-latest-using-docker-compose/12013/4 "2024-02-06T00:29:26Z")

</div>

I have removed the unused images by below command so the nexus:3.60.0 is removed.  
$ docker image prune

I have brought up another new nexus repo on a different port (9999) with latest image and the web page shows (obviously) a new version (3.64)  
$ docker run -d --name=nexusnew -p 9999:8081 sonatype/nexus3:latest

I made sure that the new and old containers used the latest image but the old container is still showing version 3.60

$ docker inspect nexus | grep Image  
“Image”: “sha256:bda195cc2883a7a3297be87771e3bd09e8e1a0e1b8f113dae864cb013072eac2”,  
“Image”: “sonatype/nexus3:latest”,

$ docker inspect nexusnew | grep Image  
“Image”: “sha256:bda195cc2883a7a3297be87771e3bd09e8e1a0e1b8f113dae864cb013072eac2”,  
“Image”: “sonatype/nexus3:latest”,

$ curl --include --silent [http://localhost:8081/](http://localhost:8081/) | grep Server  
Server: Nexus/3.60.0-02 (OSS)

$ curl --include --silent [http://localhost:9999/](http://localhost:9999/) | grep Server  
Server: Nexus/3.64.0-04 (OSS)

The only difference is the old container (3.60.0) is using the persistent volumes. I assume the data in the persistent volumes have to be updated/upgraded, which I don’t know how to do.

---

<div class="post-metadata">

### Author: ![learnit.linux](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@learnit.linux](https://community.sonatype.com/u/learnit.linux)
#### Post date: [February 15, 2024, 2:59pm UTC](https://community.sonatype.com/t/upgrade-nexus-3-6x-y-to-latest-using-docker-compose/12013/5 "2024-02-15T14:59:02Z")

</div>

I had to avoid using persistent volume for the whole /opt/sonatype instead of that, I should only map volumes for /opt/sonatype/etc/jetty and /opt/sonatype/etc/ssl. So, the jar files directories are overwritten by the new image and the new Nexus OSS version appears on the web interface.
