Create a Nexus Repository with Windows Containers

Docker is an extremely powerful tool. You often build your own image using X image or X Linux distros like Ubuntu or Debian.

In our case, we have a Nexus repository running in Windows but we started to move everything to AWS. The greatest challenge ha…


This content originally appeared on DEV Community and was authored by Federico Navarrete

Docker is an extremely powerful tool. You often build your own image using X image or X Linux distros like Ubuntu or Debian.

In our case, we have a Nexus repository running in Windows but we started to move everything to AWS. The greatest challenge happened when we were not able to migrate the DB. Regardless, the configuration we chose, the repo started to crash over and over again. The only option was to move the old VM as a new EC2 which was a bad deal since this would be our only EC2 because the rest was running in containers in ECS.

After a while, we thought of a new solution, we had heard about Windows Containers, something that is not so well-known. And this is the solution that we came with:

FROM mcr.microsoft.com/windows/nanoserver:1809
RUN mkdir "c:\\nexus"
WORKDIR c:/nexus
RUN mkdir sonatype-work
RUN mkdir nexus-3.36.0-01
COPY nexus-3.36.0-01 .
COPY sonatype-work .
WORKDIR c:/nexus/nexus-3.36.0-01/bin
EXPOSE 8081
CMD ["nexus.exe /run"]

The first line downloads a copy of Windows Nano Server, which has the smallest footprint. And later, we configured the location that we wanted.

The number 3.36.0-01 represents our current version of the Nexus repo, it can change over the years.

And that's all that you need.

Now, something important to highlight, this solution doesn't show any logs for any reason and takes some time to run it the first time. So, if you start hitting: http://localhost:8081 in minute one, it might not work, it takes a while maybe 3 to 5 minutes.


This content originally appeared on DEV Community and was authored by Federico Navarrete


Print Share Comment Cite Upload Translate Updates
APA

Federico Navarrete | Sciencx (2021-11-13T14:09:01+00:00) Create a Nexus Repository with Windows Containers. Retrieved from https://www.scien.cx/2021/11/13/create-a-nexus-repository-with-windows-containers/

MLA
" » Create a Nexus Repository with Windows Containers." Federico Navarrete | Sciencx - Saturday November 13, 2021, https://www.scien.cx/2021/11/13/create-a-nexus-repository-with-windows-containers/
HARVARD
Federico Navarrete | Sciencx Saturday November 13, 2021 » Create a Nexus Repository with Windows Containers., viewed ,<https://www.scien.cx/2021/11/13/create-a-nexus-repository-with-windows-containers/>
VANCOUVER
Federico Navarrete | Sciencx - » Create a Nexus Repository with Windows Containers. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/11/13/create-a-nexus-repository-with-windows-containers/
CHICAGO
" » Create a Nexus Repository with Windows Containers." Federico Navarrete | Sciencx - Accessed . https://www.scien.cx/2021/11/13/create-a-nexus-repository-with-windows-containers/
IEEE
" » Create a Nexus Repository with Windows Containers." Federico Navarrete | Sciencx [Online]. Available: https://www.scien.cx/2021/11/13/create-a-nexus-repository-with-windows-containers/. [Accessed: ]
rf:citation
» Create a Nexus Repository with Windows Containers | Federico Navarrete | Sciencx | https://www.scien.cx/2021/11/13/create-a-nexus-repository-with-windows-containers/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.