Skip to content

Commit d79613a

Browse files
committed
Add Dockerfile and release GH action
1 parent 90b256b commit d79613a

3 files changed

Lines changed: 56 additions & 1 deletion

File tree

.github/workflows/docker.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: docker
2+
3+
on:
4+
push:
5+
tags:
6+
- v[0-9]+.[0-9]+.[0-9]+
7+
8+
jobs:
9+
build-and-push:
10+
name: build-and-push
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Login to DockerHub
16+
uses: docker/login-action@v3
17+
with:
18+
username: ${{ secrets.DOCKERHUB_USERNAME }}
19+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
20+
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Get ref
25+
id: parse_ref
26+
run: |
27+
echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//}
28+
29+
- name: Build and push
30+
uses: docker/build-push-action@v6
31+
with:
32+
context: .
33+
push: true
34+
tags: |
35+
p2panda/bootstrap:latest
36+
p2panda/bootstrap:${{ steps.parse_ref.outputs.tag }}

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM clux/muslrust:stable AS BUILDER
2+
3+
# Add source code
4+
ADD . ./
5+
6+
# Build our application
7+
RUN cargo build --release
8+
9+
# Now, we need to build our _real_ Docker container, copying in `bootstrap`
10+
FROM alpine:latest
11+
RUN apk --no-cache add ca-certificates
12+
COPY --from=BUILDER \
13+
/volume/target/x86_64-unknown-linux-musl/release/bootstrap \
14+
/usr/local/bin/
15+
16+
ENV NETWORK_ID ""
17+
ENV RELAY_URL https://wasser.liebechaos.org
18+
19+
CMD /usr/local/bin/bootstrap --network-id $NETWORK_ID --relay-url $RELAY_URL

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Options:
5252

5353
## Example
5454

55-
`bootstrap -p "." -n chat -r https://wasser.liebechaos.org/`
55+
`bootstrap --network-id chat --relay-url https://wasser.liebechaos.org/`
5656

5757
```
5858
node id:

0 commit comments

Comments
 (0)