IDunion / indy-did-resolver

Resolver for the did:indy method
Apache License 2.0
8 stars 7 forks source link

Cannot build the docker file #25

Closed MajdT51 closed 2 years ago

MajdT51 commented 2 years ago

Hi, I'm trying to build the docker file on macOS

Steps:

  1. I clone the repository
  2. navigate to ./docker
  3. run docker build -t indy-resolver:v1 .
  4. Error:
    MacBook-Pro-von-Me:docker majdt$ docker build -t indy-resolver:v1 .
    [+] Building 1.2s (14/22)                                                                                                           
    => [internal] load build definition from Dockerfile                                                                           0.0s
    => => transferring dockerfile: 37B                                                                                            0.0s
    => [internal] load .dockerignore                                                                                              0.0s
    => => transferring context: 2B                                                                                                0.0s
    => [internal] load metadata for docker.io/library/debian:buster-slim                                                          0.7s
    => [internal] load metadata for docker.io/library/rust:1.58-buster                                                            0.7s
    => [internal] load build context                                                                                              0.0s
    => => transferring context: 32B                                                                                               0.0s
    => [builder 1/9] FROM docker.io/library/rust:1.58-buster@sha256:311d05f3823e7430bfeb2a743cd1a7895b05db643622d8d38ce18bffa2fa  0.0s
    => [stage-1 1/8] FROM docker.io/library/debian:buster-slim@sha256:7cd178f900adf3fe5659861895c9690750df784ca96839fa756c379af6  0.0s
    => CACHED [stage-1 2/8] RUN apt-get update && apt-get install ca-certificates -y && rm -rf /var/lib/apt/lists/*               0.0s
    => CACHED [builder 2/9] RUN mkdir -p /root/.cargo                                                                             0.0s
    => CACHED [builder 3/9] RUN mkdir -p /app                                                                                     0.0s
    => CACHED [builder 4/9] RUN apt-get update && apt-get install -y libzmq3-dev cmake                                            0.0s
    => CACHED [builder 5/9] WORKDIR /app                                                                                          0.0s
    => CACHED [builder 6/9] COPY . .                                                                                              0.0s
    => ERROR [builder 7/9] RUN cargo build --release                                                                              0.4s
    ------
    > [builder 7/9] RUN cargo build --release:
    #14 0.409 error: could not find `Cargo.toml` in `/app` or any parent directory
    ------
    executor failed running [/bin/sh -c cargo build --release]: exit code: 101
c2bo commented 2 years ago

Hey @MajdT51, you need to have the build context from the root folder - the Dockerfile requires access to the src files. docker build -t indy-resolver:v1 -f docker/Dockerfile . should work

c2bo commented 2 years ago

If you just want to use a custom networks folder, I think it is easier to just use the pre-built image from https://github.com/IDunion/indy-did-resolver/pkgs/container/indy-did-resolver%2Findy-did-driver and mount a network folder into it + configure the entrypoint with the flag -s <path/to/folder>

MajdT51 commented 2 years ago

Thank you