nexus-3.0.2-02.tar.gz
2、解压
3、修改data路径
vi ./bin/nexus.vmoptions
-Dkaraf.data=/home/user/tools/nexus/data
-Djava.io.tmpdir=/home/user/tools/nexus/data/tmp
4、将原来的data文件全部拷贝到当前文件目录下手5、vi /usr/lib/systemd/system/nexus.service
[Unit]
Description=kafka
After=network.target remote-fs.target nss-lookup.target zookeeper.service
ConditionPathExists=/home/user/tools/nexus
[Service]
Type=forking
User=user
ExecStart=/home/user/tools/nexus/nexus-3.0.2-02/bin/nexus start
ExecReload=/home/user/tools/nexus/nexus-3.0.2-02/bin/nexus force-reload
ExecStop=/home/user/tools/nexus/nexus-3.0.2-02/bin/nexus stop
PrivateTmp=true
[Install]
WantedBy=multi-user.target
5、配置docker repository,pypi repositry
6、本地配置
## docker repository
### 下载
包含 docker hub的代理和内部的docker repo
服务器:docker.tianrang-inc.com
1. 将 docker.tianrang-inc.com 填入insecure registries
* [macOS](http://stackoverflow.com/questions/37619277/docker-mac-beta-using-insecure-private-registry) Preference... -> Daemon tab -> Insecure registries
2. 用docker账号登陆
```bash
$ docker login docker.tianrang-inc.com
username: docker
password: docker
```
### 上传(内部 docker repo)
docker-hub.tianrang-inc.com
配置同下载
### 上传(发布 docker repo)
docker-???.tianrang-inc.com
配置同下载
## pypi repository
### 下载:(包括 douban pypi 源的代理和内部的 pypi)
http://nexus.tianrang-inc.com/repository/pypi/
命令行:
```bash
$ pip install -r requirements.txt -i http://nexus.tianrang-inc.com/repository/pypi/simple/ --trusted-host nexus.tianrang-inc.com
```
全局配置文件:
```
# ~/.pip/pip.conf
[global]
index=http://nexus.tianrang-inc.com/repository/pypi/
index-url=http://nexus.tianrang-inc.com/repository/pypi/simple/
trusted-host=nexus.tianrang-inc.com
```
### 上传:(内部的 pypi )
http://nexus.tianrang-inc.com/repository/pypi-hosted/
1. 配置文件 ~/.pypirc
```
# ~/.pypirc
[distutils]
index-servers =
nexus
[nexus]
repository = http://nexus.tianrang-inc.com/repository/pypi-hosted/
username = docker
password = docker
```
2. 用 twine 上传
```bash
$ pip install twine
$ twine upload -r nexus <filename_to_upload>
```