Skip to content

Commit

Permalink
Use rust:1.52 as a base image
Browse files Browse the repository at this point in the history
  • Loading branch information
slumber authored and Deniallugo committed Jul 7, 2021
1 parent e515338 commit 1ea8f36
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions docker/data-restore/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
# syntax=docker/dockerfile:experimental
FROM rust:1.52 as builder
RUN --mount=type=cache,target=/usr/local/cargo/registry \
cargo install sccache
FROM rust:1.52

WORKDIR /usr/src/zksync
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/root/.cache/sccache \
RUSTC_WRAPPER=/usr/local/cargo/bin/sccache \
cargo build --release --bin zksync_data_restore

FROM debian:buster-slim
RUN apt update && apt install wget openssl npm curl libpq5 libpq-dev lsb-release -y
RUN apt update && apt install wget openssl libssl-dev pkg-config npm curl libpq5 libpq-dev lsb-release -y
# PostgreSQL Apt Repository is used to install the compatible psql version.

# Create the file repository configuration:
RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
# Import the repository signing key:
Expand All @@ -23,13 +16,12 @@ RUN curl -sL https://deb.nodesource.com/setup_14.x | bash
RUN apt install nodejs -y
RUN npm install -g yarn

ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
RUN cargo install diesel_cli --no-default-features --features postgres

COPY --from=builder /usr/src/zksync/ /usr/src/zksync/
# Copy workspace
COPY . .

RUN cargo build --release --bin zksync_data_restore

# Copy configuration files for data restore.
COPY docker/exit-tool/configs /usr/src/configs
Expand Down

0 comments on commit 1ea8f36

Please sign in to comment.