]> Sergey Matveev's repositories - btrtrc.git/blob - Dockerfile
cmd/btrtrc client
[btrtrc.git] / Dockerfile
1 # On macOS, docker does not support IPv6.
2
3 FROM alpine
4
5 RUN apk add go fuse bash rustup git gcc musl-dev g++
6 RUN rustup-init -y --profile minimal
7 ENV PATH="/root/.cargo/bin:$PATH"
8
9 WORKDIR /src
10
11 COPY . .
12 RUN git clone https://github.com/anacrolix/possum
13
14 WORKDIR possum
15
16 RUN git submodule update --init --recursive
17 RUN --mount=type=cache,target=/root/.cargo/registry \
18         --mount=type=cache,target=/root/.cargo/git \
19         --mount=type=cache,target=/src/possum/target \
20         cargo build
21
22 WORKDIR ..
23
24 ARG GOCACHE=/root/.cache/go-build
25 ARG GOMODCACHE=/root/go/pkg/mod
26
27 RUN --mount=type=cache,target=$GOCACHE \
28         --mount=type=cache,target=$GOMODCACHE \
29         CGO_LDFLAGS=possum/target/debug/libpossum.a \
30         go test -failfast ./...
31
32 # # Can't use fuse inside Docker? Asks for modprobe fuse.
33
34 # RUN go install github.com/anacrolix/godo@v1
35 # RUN echo "$HOME"
36 # ENV PATH="/root/go/bin:$PATH"
37 # # RUN --mount=type=cache,target=$GOCACHE \
38 # #     --mount=type=cache,target=$GOMODCACHE \
39 # #     ./fs/test.sh