Skip to content
Snippets Groups Projects
Select Git revision
  • json-output
  • nostr
  • master default protected
  • 48-error-base-58-requirement-is-violated
  • no-rename
  • hugo/tx-comments
  • poka/dev
  • hugo/dev
  • tuxmain/mail
  • 0.4.3-RC2
  • 0.4.3-RC1
  • 0.4.2
  • 0.4.1
  • 0.4.0
  • 0.3.0
  • 0.2.17
  • 0.2.16
  • 0.2.15
  • 0.2.14
  • 0.2.13
  • 0.2.12
  • 0.2.10
  • 0.2.9
  • 0.2.8
  • 0.2.7
  • 0.2.6
  • 0.2.5
  • 0.2.4
  • 0.2.3
29 results

Dockerfile

Blame
    • Hugo Trentesaux's avatar
      bfb85c07
      add Dockerfile (!31) · bfb85c07
      Hugo Trentesaux authored
      * working dockerfile
      
      * wip dockerfile
      
      TODO make duniter-polkadot-sdk repo lighter to avoid long download time in docker build
      
      (cherry picked from commit 5f4b716f)
      
      * update subxt and polkadot sdk
      bfb85c07
      History
      add Dockerfile (!31)
      Hugo Trentesaux authored
      * working dockerfile
      
      * wip dockerfile
      
      TODO make duniter-polkadot-sdk repo lighter to avoid long download time in docker build
      
      (cherry picked from commit 5f4b716f)
      
      * update subxt and polkadot sdk
    Dockerfile 1019 B
    # FROM rustlang/rust:nightly-slim as build
    # nightly needed for -Zgit=shallow-deps build but ahash problem with stdsimd
    FROM rust:latest as build
    # # Use musl Rust image
    # FROM clux/muslrust:1.75.0-stable as build
    
    WORKDIR /app
    
    # Copy the Cargo.toml and Cargo.lock files to leverage Docker's caching mechanism
    COPY Cargo.toml Cargo.lock ./
    
    # Build the dependencies of the application separately
    RUN --mount=type=cache,target=/app/target \
        --mount=type=cache,target=/root/.cargo/registry \
        mkdir src \
        && echo "fn main() {}" > src/main.rs \
        && cargo build --release \
        && rm -r src
    
    # Copy the rest of the source code
    COPY ./res ./res
    COPY ./src ./src
    
    # Build the application
    RUN cargo build --release
    
    # Start release stage
    FROM debian as release
    
    # Set the working directory to the location of the built application
    WORKDIR /app
    
    # Copy the built application from the previous stage
    COPY --from=build /app/target/release/gcli .
    
    # Specify the entrypoint for the container
    ENTRYPOINT ["/app/gcli"]