mirror of
https://github.com/yanhao98/docker-example.git
synced 2025-07-13 04:00:47 +08:00
/unison-unicloud
This commit is contained in:
@ -12,20 +12,18 @@
|
|||||||
|
|
||||||
### 启动服务
|
### 启动服务
|
||||||
```bash
|
```bash
|
||||||
cd ~
|
mkdir -p /unison-unicloud/data /unison-unicloud/shares
|
||||||
rm -rf data shares
|
chown -R 1000:1000 /unison-unicloud/data
|
||||||
mkdir -p data shares
|
chmod 777 /unison-unicloud/shares
|
||||||
chown -R 1000:1000 data
|
docker run -d --name unison-unicloud-server \
|
||||||
chmod 777 shares
|
|
||||||
docker run -d --name server \
|
|
||||||
-e TZ=Asia/Shanghai \
|
-e TZ=Asia/Shanghai \
|
||||||
--network host \
|
--network host \
|
||||||
-e SERVER_DEBUG=True \
|
-e SERVER_DEBUG=True \
|
||||||
-e SERVER_UI_USERNAME=admin \
|
-e SERVER_UI_USERNAME=admin \
|
||||||
-e SERVER_UI_PASSWORD= \
|
-e SERVER_UI_PASSWORD= \
|
||||||
-e ROLE=SERVER \
|
-e ROLE=SERVER \
|
||||||
--mount type=bind,source=./data,target=/data \
|
--mount type=bind,source=/unison-unicloud/data,target=/data \
|
||||||
--mount type=bind,source=./shares,target=/shares \
|
--mount type=bind,source=/unison-unicloud/shares,target=/shares \
|
||||||
agarbato1/unison-unicloud:2.53.4 \
|
agarbato1/unison-unicloud:2.53.4 \
|
||||||
bash -c "echo 'Port 2222' >> /etc/sshd_config_debug && exec python3 -u start.py"
|
bash -c "echo 'Port 2222' >> /etc/sshd_config_debug && exec python3 -u start.py"
|
||||||
```
|
```
|
||||||
@ -51,34 +49,35 @@ cat ~/data/log/sshd.log
|
|||||||
|
|
||||||
|
|
||||||
### 添加 share1
|
### 添加 share1
|
||||||
在`labs`点`Open Port`打开 80 端口,跳转后打开 http://ip172-18-0-23-csabksol2o90009mnang-80.direct.labs.play-with-docker.com`/shares`
|
- 在`labs`点`Open Port`打开 80 端口
|
||||||
|
- 跳转后打开 http://ip172-18-0-23-csabksol2o90009mnang-80.direct.labs.play-with-docker.com`/shares`
|
||||||
|
- `Create Folder`选`No`
|
||||||
|
|
||||||
|
|
||||||
## Client
|
## Client
|
||||||
```bash
|
```bash
|
||||||
curl 192.168.0.8:80/status -v
|
curl 192.168.0.18:80/status -v
|
||||||
|
|
||||||
cd ~
|
mkdir -p /unison-unicloud/data /unison-unicloud/share
|
||||||
rm -rf data share
|
chown -R 1000:1000 /unison-unicloud/data
|
||||||
mkdir -p data share
|
# chmod 777 /unison-unicloud/share
|
||||||
chmod 777 data share
|
docker run -d --name unison-unicloud-client \
|
||||||
docker run -d --name client1 \
|
|
||||||
-e TZ=Asia/Shanghai \
|
-e TZ=Asia/Shanghai \
|
||||||
--restart on-failure \
|
--restart on-failure \
|
||||||
--network host \
|
--network host \
|
||||||
-e CLIENT_HOSTNAME=client_hostname1 \
|
-e CLIENT_HOSTNAME=client_hostname1 \
|
||||||
-e ROLE=CLIENT \
|
-e ROLE=CLIENT \
|
||||||
-e SERVER_HOSTNAME=192.168.0.8 \
|
-e SERVER_HOSTNAME=192.168.0.18 \
|
||||||
-e SERVER_PORT=2222 \
|
-e SERVER_PORT=2222 \
|
||||||
-e SERVER_SHARE=share1 \
|
-e SERVER_SHARE=share1 \
|
||||||
-e API_PROTOCOL=http \
|
-e API_PROTOCOL=http \
|
||||||
-e API_PORT=80 \
|
-e API_PORT=80 \
|
||||||
-e SYNC_INTERVAL=15 \
|
-e SYNC_INTERVAL=15 \
|
||||||
--mount type=bind,source=./data,target=/data \
|
--mount type=bind,source=/unison-unicloud/data,target=/data \
|
||||||
-e CLIENT_DEST=/share \
|
-e CLIENT_DEST=/share \
|
||||||
--mount type=bind,source=./share,target=/share \
|
--mount type=bind,source=/unison-unicloud/share,target=/share \
|
||||||
agarbato1/unison-unicloud:2.53.4
|
agarbato1/unison-unicloud:2.53.4
|
||||||
docker logs -f client1
|
docker logs -f unison-unicloud-client
|
||||||
```
|
```
|
||||||
|
|
||||||
### 激活
|
### 激活
|
||||||
@ -88,7 +87,7 @@ docker logs -f client1
|
|||||||
|
|
||||||
## 测试同步
|
## 测试同步
|
||||||
```
|
```
|
||||||
touch ~/share/$(date +%s).txt
|
touch /unison-unicloud/share/$(date +%s).txt
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
Reference in New Issue
Block a user