-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile.lc
65 lines (45 loc) · 1.58 KB
/
Dockerfile.lc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Use an official Golang image as a base image
FROM golang:1.23-alpine AS builder
# Set environment variables for CGO flags
ENV CGO_CFLAGS="-O2 -D__BLST_PORTABLE__"
ENV CGO_CXXFLAGS="-O2 -D__BLST_PORTABLE__"
ENV CGO_LDFLAGS="-O2 -D__BLST_PORTABLE__"
# Install necessary dependencies
RUN apk add --no-cache git make bash curl
# Set the working directory for IPFS Kubo
WORKDIR /go/src/ipfs-kubo
# Clone the IPFS Kubo repository
RUN git clone https://github.com/ipfs/kubo.git .
RUN git fetch --all --tags
# Checkout the specific version v0.32.1
RUN git checkout v0.32.1
# Build IPFS Kubo
RUN make build
# Set the working directory for the light-client
WORKDIR /go/src/light-client
RUN apk add --no-cache gcc musl-dev
# Clone the light-client repository
COPY . .
# Build the light-client
RUN make build-light
# Create a minimal runtime image
FROM alpine:latest
# Copy the built IPFS Kubo binary
COPY --from=builder /go/src/ipfs-kubo/cmd/ipfs/ipfs /usr/local/bin/ipfs
# Copy the built light-client binary
COPY --from=builder /go/src/light-client/bin/light-client /usr/local/bin/light-client
# Copy trusted setup files
COPY --from=builder /go/src/light-client/test/data/trusted_setup.txt /root/.covalent/trusted_setup.txt
# Expose the default IPFS port
EXPOSE 4001
# Expose the default IPFS API port
EXPOSE 5001
# Expose the default IPFS Gateway port
EXPOSE 8080
# Initialize IPFS
RUN ipfs init
# Copy the entrypoint script
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
# Set the entrypoint for the container
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]