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

docker-desktop cannot build it #12

Open
fanspace opened this issue May 9, 2023 · 4 comments
Open

docker-desktop cannot build it #12

fanspace opened this issue May 9, 2023 · 4 comments

Comments

@fanspace
Copy link

fanspace commented May 9, 2023

docker desktop version :
图片

D:\gitpro\microservice-rust-mysql>docker compose up
[+] Running 1/1
! server Warning 21.0s
[+] Building 15.8s (6/6) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.08kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> resolve image config for docker.io/docker/dockerfile:1 15.4s
=> CACHED docker-image://docker.io/docker/dockerfile:1@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cf 0.0s
=> [internal] load .dockerignore 0.0s
=> [internal] load build definition from Dockerfile 0.0s
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc error: code = Unknown desc = dockerfile parse error on line 6: unknown instruction: set (did you mean user?)

#it works after modify like below
`FROM --platform=$BUILDPLATFORM rust:1.64 AS buildbase
WORKDIR /src
RUN apt-get update && apt-get install -y
git
clang
&& rustup target add wasm32-wasi

RUN curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash

FROM buildbase AS build
COPY Cargo.toml orders.json update_order.json .
COPY src ./src

RUN --mount=type=cache,target=/usr/local/cargo/git/db
--mount=type=cache,target=/usr/local/cargo/registry/cache
--mount=type=cache,target=/usr/local/cargo/registry/index
cargo build --target wasm32-wasi --release

RUN /root/.wasmedge/bin/wasmedgec target/wasm32-wasi/release/order_demo_service.wasm order_demo_service.wasm

FROM scratch
ENTRYPOINT [ "order_demo_service.wasm" ]
COPY --from=build /src/order_demo_service.wasm /order_demo_service.wasm`

@hydai
Copy link
Member

hydai commented Jun 19, 2023

Hi @fanspace
Please update to the latest docker-desktop and try again.

CleanShot 2023-06-19 at 16 43 32

And you will need an extra flag to workaround an issue: ac7bbed

Then, docker compose up

CleanShot 2023-06-19 at 16 55 27

@dierbei
Copy link

dierbei commented Jun 20, 2023

I do it like this

image

@rphuber
Copy link

rphuber commented Jul 28, 2023

I can not build the container either. Even after using docker desktop with the containerd and wasm features enabled and using the correct env variable I get issues with either the container hanging when trying to build (and unable to cancel) or error response from the daemon: failed to create container: unknown.

CleanShot 2023-07-28 at 16 54 15@2x CleanShot 2023-07-28 at 16 54 38@2x CleanShot 2023-07-28 at 16 54 54@2x CleanShot 2023-07-28 at 16 59 48@2x

any ideas here?

@hydai
Copy link
Member

hydai commented Aug 25, 2023

Hi @rphuber
Could you please try the latest master branch with the latest docker desktop? We fixed a DNS nameserver issue just a few hours ago.

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

4 participants