DSpeckhals / bible.rs

A Bible server written in Rust using Actix Web and Diesel
https://bible.rs
MIT License
221 stars 24 forks source link

Isssue on running docker #75

Closed passionate2023 closed 1 year ago

passionate2023 commented 1 year ago

C:\Users\admin\Downloads\bible.rs-master\bible.rs-master>docker build -t biblers . && docker run -p 8080:8080 --rm -it biblers error during connect: This error may indicate that the docker daemon is not running.: Post "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=biblers&target=&ulimits=null&version=1": open //./pipe/docker_engine: The system cannot find the file specified.

DSpeckhals commented 1 year ago

This looks like a problem with your host system's Docker installation or configuration, not this software. Sorry.

passionate2023 commented 1 year ago

Can you please kindly help me with the following?

  1. pre-requisites softwares
  2. steps to build and run
DSpeckhals commented 1 year ago
  1. Pull this repo and its sub-modules: git clone https://github.com/DSpeckhals/bible.rs.git --recurse-submodles
  2. If you don't have a Rust compiler, follow these instructions.
  3. Make sure you have libsqlite3 installed on your system (either a shared library or a DLL on Windows)
  4. To compile the SQLite bindings, you'll need a recent Clang compiler and LLVM libraries.
  5. You'll need a SASS compiler to compile the CSS. I use sassc.

To build and run:

  1. From the root of this repository: cargo build --release
  2. To compile the sass: sassc web/styles/index.scss web/dist/css/style.css
  3. DATABASE_URL=/tmp/biblers ./target/release/biblers

You can also see the basic steps in the Dockerfile. Running with Docker is probably your easiest choice though, and that's why it's highlighted in the README.

passionate2023 commented 1 year ago

from where this Docket content will be pulled from ? Is it a permanent repo is associated with ? I meant repository like maven repository or jfrog

passionate2023 commented 1 year ago

Error:

thread 'main' panicked at 'Unable to find libclang: "couldn't find any valid shared libraries matching: ['clang.dll', 'libclang.dll'], set the LIBCLANG_PATH environment variable to a path where one of these files can be found (invalid: [])"', C:\Users\admin.cargo\registry\src\index.crates.io-6f17d22bba15001f\bindgen-0.59.2\src/lib.rs:2144:31 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace warning: build failed, waiting for other jobs to finish...

===

error: failed to run custom build command for libsqlite3-sys v0.24.2

Caused by: process didn't exit successfully: C:\Users\admin\Downloads\bible.rs-master\bible.rs-master\target\release\build\libsqlite3-sys-68d97dd91c078e76\build-script-build (exit code: 101) --- stdout

passionate2023 commented 1 year ago

error: failed to run custom build command for libsqlite3-sys v0.24.2

Caused by: process didn't exit successfully: C:\Users\admin\Downloads\bible.rs-master\bible.rs-master\target\release\build\libsqlite3-sys-68d97dd91c078e76\build-script-build (exit code: 101) --- stdout

passionate2023 commented 1 year ago

'sassc' is not recognized as an internal or external command,

DSpeckhals commented 1 year ago

You don't have a Clang compiler in your path, either because it's not installed or because it's not in your path. Also, it looks like sassc isn't there either. You can use Google to see how to install these on Windows, but it's not simple if you're unaccustomed to compiling system utilities on Windows.

If you want to avoid the Clang/LLVM toolchain, comment out or remove these lines in db/Cargo.toml: https://github.com/DSpeckhals/bible.rs/blob/21491f833ad3070b36e4f6a513c44afda16a95a0/db/Cargo.toml#L12-L15

I still have a feeling Docker is going to be your best bet on Windows though. If you're familiar with Docker, you might try pulling docker.io/dspeckhals/bible.rs, then running docker run --rm -it dspeckhals/bible.rs:latest -p 8080:8080. If you can't make it past these steps, I would suggest reading up on compiling software from source on Windows and running Docker containers on Windows.

passionate2023 commented 1 year ago

I will try but

  1. docker.io/dspeckhals/bible.rs link is not working
  2. how to create a docker image with the source is not clear....help me how to build a docker image
  3. If we got the steps to build the docker image from the source code, then running the docker would be a bit easy one
DSpeckhals commented 1 year ago
  1. Sorry, try docker pull dspeckhals/bible.rs if you want a pre-built image.
  2. Creating the Docker image should be as simple as running docker build -t biblers .. Once it's built, then run docker run -p 8080:8080 --rm -it biblers.
  3. Building from source without Docker on Windows is non-trivial. You're welcome to try, though. Building inside a container as mentioned above should be easier.
passionate2023 commented 1 year ago

1 is success in windows 10

2 - part a build is success - however part b running failing with following error

image

Please kindly let me know how to fix this.

DSpeckhals commented 1 year ago

It looks like you didn't initialize this repo with its submodule dependencies, specifically the https://github.com/DSpeckhals/bible.rs-migrations repo.

Try running this from the repo root git submodule update --init, then rebuild the Rust project (docker build -t biblers .)

passionate2023 commented 1 year ago

Great....Thank you So much....Below are the steps....Please update in read me if possible...The below steps are working awesome !!!!

  1. git clone https://github.com/DSpeckhals/bible.rs.git
  2. cd bible.rs
  3. git submodule update --init
  4. docker build -t biblers .
  5. docker pull dspeckhals/bible.rs
  6. docker build -t biblers .
  7. docker run -p 8080:8080 --rm -it biblers