Skip to content

Commit d50c258

Browse files
authored
Merge pull request #8 from suda/chore/update-base-image
Update base image to Alpine 3.17.1 and Python to 3
2 parents 01b449f + 4950908 commit d50c258

File tree

6 files changed

+16
-37
lines changed

6 files changed

+16
-37
lines changed

.github/workflows/docker-image.yml

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,3 @@
1-
name: Docker Image CI
2-
3-
on:
4-
push:
5-
tags:
6-
- '*'
7-
pull_request:
8-
branches: [ "main" ]
9-
10-
jobs:
11-
build:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v3
15-
- name: Build the Docker image
16-
env:
17-
IMAGE_TAG: ${{ github.sha }}
18-
run:
19-
docker build . --file Dockerfile.server --tag ghcr.io/suda/dvsync-server:${IMAGE_TAG}
20-
docker build . --file Dockerfile.client --tag ghcr.io/suda/dvsync-client:${IMAGE_TAG}
21-
221
name: Tag Docker Image with Git
232

243
on:
@@ -62,15 +41,15 @@ jobs:
6241
- name: Build and push the server image
6342
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
6443
with:
65-
context: Dockerfile.server
44+
file: Dockerfile.server
6645
push: true
6746
tags: ${{ steps.servermeta.outputs.tags }}
6847
labels: ${{ steps.servermeta.outputs.labels }}
6948

7049
- name: Build and push the client image
7150
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
7251
with:
73-
context: Dockerfile.client
52+
file: Dockerfile.client
7453
push: true
7554
tags: ${{ steps.clientmeta.outputs.tags }}
7655
labels: ${{ steps.clientmeta.outputs.labels }}

Dockerfile.client

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.10.2
1+
FROM alpine:3.17.1
22

33
RUN apk add --no-cache rsync openssh \
44
&& apk add --no-cache --virtual .build-deps git openssh \

Dockerfile.server

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
FROM alpine:3.10.2
1+
FROM alpine:3.17.1
22

3-
RUN apk add --no-cache python2 py2-pip curl ca-certificates openssh-server rsync \
3+
RUN apk add --no-cache python3 py3-pip curl ca-certificates openssh-server rsync \
44
&& apk add --no-cache --virtual .build-deps git \
55
&& curl -L -O https://bin.equinox.io/a/jYLcLYYDPtj/ngrok-2.3.17-linux-amd64.zip \
66
&& unzip ngrok-2.3.17-linux-amd64.zip \
77
&& install -v -D ngrok /usr/local/bin/ngrok \
8-
&& pip install supervisor \
9-
&& pip install git+https://github.com/bendikro/supervisord-dependent-startup.git@v1.1.0 \
8+
&& pip install supervisor
9+
RUN pip install git+https://github.com/suda/supervisord-dependent-startup.git \
1010
&& curl -L -O https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 \
1111
&& install -v -D jq-linux64 /usr/local/bin/jq \
1212
&& rm -f ngrok-stable-linux-amd64.zip ngrok jq-linux64 \

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
1111
`dvsync` is a set of two containers running [OpenSSH](https://www.openssh.com/), [ngrok](https://ngrok.com/) and [rsync](https://rsync.samba.org/) that automatically create a secure, encrypted channel between each other and enable easy way to migrate data stored in Docker volumes.
1212

13-
**Client:** [![dvsync-client](https://quay.io/repository/suda/dvsync-client/status "Docker Repository on Quay")](https://quay.io/repository/suda/dvsync-client) **Server:** [![dvsync-client](https://quay.io/repository/suda/dvsync-server/status "Docker Repository on Quay")](https://quay.io/repository/suda/dvsync-server)
14-
1513
<hr />
1614

1715
![](media/dvsync.gif)
@@ -30,15 +28,15 @@ Here are example ways to run it using [Docker CLI](#docker-cli), [Docker Compose
3028
```sh
3129
docker run --rm -e NGROK_AUTHTOKEN="$NGROK_AUTHTOKEN" \
3230
--mount source=MY_SOURCE_VOLUME,target=/data,readonly \
33-
quay.io/suda/dvsync-server
31+
ghcr.io/suda/dvsync-server
3432
```
3533

3634
2. Once the server started, look into the logs and copy the `DVSYNC_TOKEN`
3735
3. Start the client where you want tot copy the data **to**:
3836
```sh
3937
docker run --rm -e DVSYNC_TOKEN="$DVSYNC_TOKEN" \
4038
--mount source=MY_TARGET_VOLUME,target=/data \
41-
quay.io/suda/dvsync-client
39+
ghcr.io/suda/dvsync-client
4240
```
4341

4442
#### Using local source/target
@@ -47,7 +45,7 @@ Alternatively, if you want to copy this data to your local machine, you can moun
4745
```sh
4846
docker run --rm -e DVSYNC_TOKEN="$DVSYNC_TOKEN" \
4947
-v $PWD:/data \
50-
quay.io/suda/dvsync-client
48+
ghcr.io/suda/dvsync-client
5149
```
5250
This can also be done other way around, when you start the server locally if you need to copy local data into the data center.
5351

@@ -58,7 +56,7 @@ This can also be done other way around, when you start the server locally if you
5856
version: '3.6'
5957
services:
6058
dvsync-server:
61-
image: 'quay.io/suda/dvsync-server'
59+
image: 'ghcr.io/suda/dvsync-server'
6260
environment:
6361
NGROK_AUTHTOKEN: ${NGROK_AUTHTOKEN}
6462
volumes:
@@ -76,7 +74,7 @@ volumes:
7674
version: '3.6'
7775
services:
7876
dvsync-server:
79-
image: 'quay.io/suda/dvsync-client'
77+
image: 'ghcr.io/suda/dvsync-client'
8078
environment:
8179
DVSYNC_TOKEN: ${DVSYNC_TOKEN}
8280
volumes:
@@ -97,7 +95,7 @@ metadata:
9795
name: dvsync-server
9896
spec:
9997
containers:
100-
- image: quay.io/suda/dvsync-server
98+
- image: ghcr.io/suda/dvsync-server
10199
name: dvsync-server
102100
env:
103101
- name: NGROK_AUTHTOKEN
@@ -117,7 +115,7 @@ metadata:
117115
name: dvsync-client
118116
spec:
119117
containers:
120-
- image: quay.io/suda/dvsync-client
118+
- image: ghcr.io/suda/dvsync-client
121119
name: dvsync-client
122120
env:
123121
- name: DVSYNC_TOKEN

bin/dvsync-init

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ echo -e "\n🔑 Generating client RSA key..."
1414
ssh-keygen -f ~/.ssh/client_rsa -N '' -q
1515
cp ~/.ssh/client_rsa.pub ~/.ssh/authorized_keys
1616

17+
echo -e "\n🔐 Setting ngrok auth token..."
1718
ngrok authtoken ${NGROK_AUTHTOKEN} > /dev/null

etc/supervisord.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface
2121
command=/usr/bin/supervisord-dependent-startup
2222
autostart=true
2323
events=PROCESS_STATE
24+
buffer_size=20
2425
environment=SUPERVISOR_USERNAME="root",SUPERVISOR_PASSWORD="shibboleet"
2526

2627
[program:dvsync-init]

0 commit comments

Comments
 (0)