Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run 'cargo make docker' #3

Open
Jibbajabbafic opened this issue Nov 24, 2022 · 2 comments
Open

Unable to run 'cargo make docker' #3

Jibbajabbafic opened this issue Nov 24, 2022 · 2 comments

Comments

@Jibbajabbafic
Copy link

Hi,
I tried to follow the instructions in the README but it fails when running cargo make docker (using Debian in WSL2).
I see the conduit-web is marked as WIP so is there a more stable commit I could try running this on?

Many thanks for making this example!

Logs

$ cargo make docker
[cargo-make] INFO - cargo make 0.36.3
[cargo-make] INFO - Build File: Makefile.toml
[cargo-make] INFO - Task: docker
[cargo-make] INFO - Profile: development
[cargo-make] INFO - Running Task: legacy-migration
[cargo-make] INFO - Execute Command: "docker" "compose" "-f" "./deploy/docker-compose.metrics.yml" "-f" "./deploy/docker-compose.postgres.yml" "-f" "./deploy/docker-compose.conduit-bin.yml" "-f" "./deploy/docker-compose.conduit-web.yml" "up" "--build"
[+] Building 2.6s (33/34)                                                                                                                                                                                                                                                                    
 => [deploy-realworld_rust_axum_sqlx_conduit_web internal] load build definition from Dockerfile                                                                                                                                                                                        0.0s
 => => transferring dockerfile: 32B                                                                                                                                                                                                                                                     0.0s
 => [deploy-realworld_rust_axum_sqlx_conduit_bin internal] load build definition from Dockerfile                                                                                                                                                                                        0.0s
 => => transferring dockerfile: 32B                                                                                                                                                                                                                                                     0.0s
 => [deploy-realworld_rust_axum_sqlx_conduit_web internal] load .dockerignore                                                                                                                                                                                                           0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                         0.0s
 => [deploy-realworld_rust_axum_sqlx_conduit_bin internal] load .dockerignore                                                                                                                                                                                                           0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                         0.0s
 => [deploy-realworld_rust_axum_sqlx_conduit_web internal] load metadata for docker.io/library/nginx:latest                                                                                                                                                                             2.2s
 => [deploy-realworld_rust_axum_sqlx_conduit_web internal] load metadata for docker.io/library/rust:1.61.0-slim-bullseye                                                                                                                                                                2.1s
 => [deploy-realworld_rust_axum_sqlx_conduit_bin internal] load metadata for docker.io/library/debian:11.3-slim                                                                                                                                                                         1.9s
 => [auth] library/debian:pull token for registry-1.docker.io                                                                                                                                                                                                                           0.0s
 => [auth] library/rust:pull token for registry-1.docker.io                                                                                                                                                                                                                             0.0s
 => [auth] library/nginx:pull token for registry-1.docker.io                                                                                                                                                                                                                            0.0s
 => [deploy-realworld_rust_axum_sqlx_conduit_web build  1/13] FROM docker.io/library/rust:1.61.0-slim-bullseye@sha256:e649e005ae0cf04ed9db8f577dbabbed6cc25da4f0b63595e4f90146f5129bab                                                                                                  0.0s
 => [deploy-realworld_rust_axum_sqlx_conduit_bin internal] load build context                                                                                                                                                                                                           0.0s
 => => transferring context: 250.56kB                                                                                                                                                                                                                                                   0.0s
 => [deploy-realworld_rust_axum_sqlx_conduit_bin deploy 1/4] FROM docker.io/library/debian:11.3-slim@sha256:f6957458017ec31c4e325a76f39d6323c4c21b0e31572efa006baa927a160891                                                                                                            0.0s
 => CACHED [deploy-realworld_rust_axum_sqlx_conduit_bin deploy 2/4] RUN set -eux;     export DEBIAN_FRONTEND=noninteractive;     apt update;     apt install --yes --no-install-recommends bind9-dnsutils iputils-ping iproute2 curl ca-certificates htop;     apt clean autoclean;     0.0s
 => CACHED [deploy-realworld_rust_axum_sqlx_conduit_bin deploy 3/4] WORKDIR /deploy                                                                                                                                                                                                     0.0s
 => CACHED [deploy-realworld_rust_axum_sqlx_conduit_web build  2/13] WORKDIR /app                                                                                                                                                                                                       0.0s
 => CACHED [deploy-realworld_rust_axum_sqlx_conduit_bin build  3/13] COPY ./rust-toolchain ./                                                                                                                                                                                           0.0s
 => CACHED [deploy-realworld_rust_axum_sqlx_conduit_bin build  4/13] COPY ./Cargo.lock ./                                                                                                                                                                                               0.0s
 => CACHED [deploy-realworld_rust_axum_sqlx_conduit_bin build  5/13] COPY ./Cargo.toml ./                                                                                                                                                                                               0.0s
 => CACHED [deploy-realworld_rust_axum_sqlx_conduit_bin build  6/13] COPY ./.env.docker ./.env                                                                                                                                                                                          0.0s
 => CACHED [deploy-realworld_rust_axum_sqlx_conduit_bin build  7/13] COPY ./crates/conduit-bin ./crates/conduit-bin                                                                                                                                                                     0.0s
 => CACHED [deploy-realworld_rust_axum_sqlx_conduit_bin build  8/13] COPY ./crates/conduit-web ./crates/conduit-web                                                                                                                                                                     0.0s
 => CACHED [deploy-realworld_rust_axum_sqlx_conduit_bin build  9/13] COPY ./crates/conduit-api ./crates/conduit-api                                                                                                                                                                     0.0s
 => CACHED [deploy-realworld_rust_axum_sqlx_conduit_bin build 10/13] COPY ./crates/conduit-core ./crates/conduit-core                                                                                                                                                                   0.0s
 => CACHED [deploy-realworld_rust_axum_sqlx_conduit_bin build 11/13] COPY ./crates/conduit-domain ./crates/conduit-domain                                                                                                                                                               0.0s
 => CACHED [deploy-realworld_rust_axum_sqlx_conduit_bin build 12/13] COPY ./crates/conduit-infrastructure ./crates/conduit-infrastructure                                                                                                                                               0.0s
 => CANCELED [deploy-realworld_rust_axum_sqlx_conduit_bin build 13/13] RUN --mount=type=cache,target=/app/target     --mount=type=cache,target=/usr/local/cargo/registry     --mount=type=cache,target=/usr/local/cargo/git     --mount=type=cache,target=/usr/local/rustup     set -e  0.4s
 => [deploy-realworld_rust_axum_sqlx_conduit_web internal] load build context                                                                                                                                                                                                           0.0s
 => => transferring context: 4.75kB                                                                                                                                                                                                                                                     0.0s
 => CACHED [deploy-realworld_rust_axum_sqlx_conduit_web deploy 1/2] FROM docker.io/library/nginx:latest@sha256:e209ac2f37c70c1e0e9873a5f7231e91dcd83fdf1178d8ed36c2ec09974210ba                                                                                                         0.0s
 => CACHED [deploy-realworld_rust_axum_sqlx_conduit_web build 3/5] COPY ./crates/conduit-web ./crates/conduit-web                                                                                                                                                                       0.0s
 => CACHED [deploy-realworld_rust_axum_sqlx_conduit_web build 4/5] COPY ./crates/conduit-domain ./crates/conduit-domain                                                                                                                                                                 0.0s
 => CACHED [deploy-realworld_rust_axum_sqlx_conduit_web build 5/5] RUN --mount=type=cache,target=/app/target     --mount=type=cache,target=/usr/local/cargo/registry     --mount=type=cache,target=/usr/local/cargo/git     --mount=type=cache,target=/usr/local/rustup     set -eux    0.0s
 => ERROR [deploy-realworld_rust_axum_sqlx_conduit_web deploy 2/2] COPY --from=build /app/crates/conduit-web/dist /usr/share/nginx/html                                                                                                                                                 0.0s
------
 > [deploy-realworld_rust_axum_sqlx_conduit_web deploy 2/2] COPY --from=build /app/crates/conduit-web/dist /usr/share/nginx/html:
------
failed to solve: failed to compute cache key: "/app/crates/conduit-web/dist" not found: not found
[cargo-make] ERROR - Error while executing command, exit code: 17
[cargo-make] WARN - Build Failed.```
@JoeyMckenzie
Copy link
Owner

Looks like a missing build directory for the yew frontend. It appears I may have some missing build steps for trunk to build the frontend before copying things over into the deployment container. Haven't had much time to look back into this project, but plan on doing so soon.

@chaos-pattern
Copy link

@Jibbajabbafic Just create an empty dist directory in conduit-web! Hope that works for you. You may also need to install npm and newman for tests to run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants