Nexus: Difference between revisions
Jump to navigation
Jump to search
Line 138: | Line 138: | ||
* [https://support.sonatype.com/hc/en-us/articles/115013153887-Docker-Repository-Configuration-and-Client-Connection Docker Repository Configuration and Client Connection] | * [https://support.sonatype.com/hc/en-us/articles/115013153887-Docker-Repository-Configuration-and-Client-Connection Docker Repository Configuration and Client Connection] | ||
* [https://blog.sonatype.com/how-to-get-started-with-nexus-repository-manager-oss Getting Start With Nexus Repository Manager OSS] | * [https://blog.sonatype.com/how-to-get-started-with-nexus-repository-manager-oss Getting Start With Nexus Repository Manager OSS] | ||
* [https://devopscube.com/how-to-install-latest-sonatype-nexus-3-on-linux/ Install Latest Sonatype Nexus 3 on Linux] | * [https://devopscube.com/how-to-install-latest-sonatype-nexus-3-on-linux/ Install Latest Sonatype Nexus 3 on Linux] | ||
* [https://www.sonatype.com/download-oss-sonatype Download Nexus Repository OSS] | * [https://www.sonatype.com/download-oss-sonatype Download Nexus Repository OSS] | ||
* [https://help.sonatype.com/repomanager2/managing-maven-settings/nexus-m2settings-maven-plugin Nexus M2Settings Maven Plugin] | * [https://help.sonatype.com/repomanager2/managing-maven-settings/nexus-m2settings-maven-plugin Nexus M2Settings Maven Plugin] | ||
* [https://docs.docker.com/storage/volumes/ Managing Data in Containers] | |||
* [https://hub.docker.com/r/sonatype/nexus3 Sonatype Nexus3 Docker] | * [https://hub.docker.com/r/sonatype/nexus3 Sonatype Nexus3 Docker] | ||
* [https://help.sonatype.com/repomanager3/system-requirements System Requirements] | * [https://help.sonatype.com/repomanager3/system-requirements System Requirements] | ||
Line 148: | Line 148: | ||
| valign="top" | | | valign="top" | | ||
* [https:// | * [https://blog.sonatype.com/using-nexus-3-as-your-repository-part-3-docker-images Configure Nexus 3 as Private Docker Repository] | ||
* [https:// | * [https://blog.sonatype.com/using-nexus-3-as-your-repository-part-1-maven-artifacts Configure Nexus 3 as Private Maven Repository] | ||
* [https://blog.sonatype.com/using-nexus-3-as-your-repository-part-2-npm-packages Configure Nexus 3 as Private NPM Repository] | |||
|} | |} |
Revision as of 23:30, 9 August 2020
scp /Users/chorke/Downloads/nexus-3.22.1-02-unix.tar.gz [email protected]:~
cd /usr/local/
sudo tar -xvzf /home/pi/nexus-3.22.1-02-unix.tar.gz
sudo ln -s nexus-3.22.1-02 nexus
cd nexus/bin/
./nexus status
CentOS
cd /opt; tar -xvzf nexus-3.22.1-02-unix.tar.gz
ln -s /opt/nexus-3.22.1-02 /var/nexus
mkdir /var/sonatype-work
vim /var/nexus/bin/nexus.rc
useradd nexus --shell=/sbin/nologin
chown -R nexus:nexus /var/sonatype-work
chown -R nexus:nexus /var/nexus
vim /var/nexus/bin/nexus.vmoptions
vim /etc/systemd/system/nexus.service
[Unit]
Description=nexus service
After=network.target
[Service]
Type=forking
LimitNOFILE=65536
User=nexus
Group=nexus
ExecStart=/var/nexus/bin/nexus start
ExecStop=/var/nexus/bin/nexus stop
User=nexus
Restart=on-abort
[Install]
WantedBy=multi-user.target
chkconfig nexus on
systemctl enable nexus
systemctl enable nexus.service
systemctl start nexus
Docker
Config
Linux: export NEXUS_HOME=/srv/nexus |
MacOS: export NEXUS_HOME=$HOME/nexus |
Volume
Local location | Container location | Usage |
---|---|---|
$NEXUS_HOME/nexus3/nexus-data |
/nexus-data |
For storing nexus data |
Install
docker pull sonatype/nexus3:3.22.0
docker run -d -p 8081:8081 --name nexus sonatype/nexus3:3.22.0
docker run -d -p 8081:8081 --name nexus -e NEXUS_CONTEXT=nexus sonatype/nexus3:3.22.0
docker run -d -p 8081:8081 --name nexus -e NEXUS_CONTEXT=nexus sonatype/nexus3:3.22.1
docker run --detach \
--env NEXUS_CONTEXT=nexus \
--publish 8081:8081 \
--name nexus \
--volume $NEXUS_HOME/nexus3/nexus-data:/nexus-data \
sonatype/nexus3:latest
docker exec -it nexus bash
echo $(cat /nexus-data/admin.password)
exit
docker start nexus
docker stop nexus
Proxy for Https
<Location /nexus>
Order Allow,Deny
Allow from all
ProxyPass http://localhost:8081/nexus nocanon
ProxyPassReverse http://localhost:8081/nexus
RequestHeader set X-Forwarded-Proto "https"
</Location>
Distribution
<settings>
[...]
<profiles>
<profile>
<id>nex</id>
<properties>
<altSnapshotDeploymentRepository>snapshots::default::https://nex.chorke.org/repository/maven/snapshots</altSnapshotDeploymentRepository>
<altReleaseDeploymentRepository>releases::default::https://nex.chorke.org/repository/maven/releases</altReleaseDeploymentRepository>
</properties>
</profile>
</profiles>
</settings>