-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrunner.dockerfile
More file actions
68 lines (48 loc) · 1.83 KB
/
Copy pathrunner.dockerfile
File metadata and controls
68 lines (48 loc) · 1.83 KB
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
66
67
68
# Build Stage
FROM rust:latest AS builder
# Instalacja zależności: curl, git, bash, unzip oraz asdf
RUN apt-get update && apt-get install -y \
curl \
git \
bash \
unzip \
&& rm -rf /var/lib/apt/lists/*
# Instalacja asdf
RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.1
# Dodanie asdf do zmiennych środowiskowych
ENV PATH="/root/.asdf/bin:/root/.asdf/shims:${PATH}"
# Instalacja pluginu scarb
RUN asdf plugin add scarb
# Instalacja scarb
RUN asdf install scarb 2.8.4
RUN asdf global scarb 2.8.4
# Praca w katalogu projektu
WORKDIR /usr/src/starknet-rpc-tests
# Kopiowanie Cargo.toml i Cargo.lock, aby cache'ować zależności
COPY Cargo.toml Cargo.lock ./
# Kopiowanie reszty projektu
COPY . .
RUN scarb build && cargo build
RUN cargo build --release --bin openrpc-testgen-runner --features katana
# Budowanie aplikacji
WORKDIR /usr/src/starknet-rpc-tests/openrpc-testgen-runner
ENV CARGO_TARGET_DIR=/usr/src/starknet-rpc-tests/openrpc-testgen-runner/target
# Budowanie aplikacji z Cargo
RUN cargo build --release --bin openrpc-testgen-runner --features katana
# Final Stage (produkcja)
FROM ubuntu:22.04
# Instalowanie tylko niezbędnych zależności dla uruchomienia aplikacji
RUN apt-get update && apt-get install -y \
libssl3 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/src/starknet-rpc-tests/target /usr/src/starknet-rpc-tests/target
# Kopiowanie skompilowanego pliku binarnego
COPY --from=builder /usr/src/starknet-rpc-tests/openrpc-testgen-runner/target/release/openrpc-testgen-runner /usr/local/bin/openrpc-testgen-runner
# Określenie katalogu roboczego
WORKDIR /app
# Domyślny punkt wejścia
# ENTRYPOINT ["/usr/local/bin/openrpc-testgen-runner"]
ENTRYPOINT ["/bin/bash"]
# Opcjonalnie, możesz dodać argumenty do aplikacji (np. --help)
# CMD ["--help"]