Skip to content

Commit 01e00c4

Browse files
committed
support docker
1 parent 0129593 commit 01e00c4

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Dockerfile
2+
target
3+
result

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM rust:alpine3.18 as builder
2+
WORKDIR /app
3+
RUN apk add --no-cache musl-dev
4+
RUN apk add --no-cache pkgconfig
5+
RUN apk add --no-cache libressl-dev
6+
COPY . .
7+
RUN ["cargo","build","--release"]
8+
9+
FROM alpine
10+
WORKDIR /app
11+
COPY --from=builder /app/target/release/fast-cf /app
12+
COPY --from=builder /app/docker-entrypoint.sh /app
13+
COPY --from=builder /app/cloudflare_ipv4.txt /app
14+
RUN ["chmod", "+x" ,"/app/docker-entrypoint.sh"]
15+
CMD [ "/app/docker-entrypoint.sh" ]

docker-entrypoint.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
./fast-cf
3+
cat result/sorted_ping_ip.txt

0 commit comments

Comments
 (0)