Sign inSign up

nokotan/emscripten-compiler

By nokotan

•Updated over 1 year ago

emscripten の docker image を作りたい

Image
0

3.2K

nokotan/emscripten-compiler repository overview

⁠emscripten-compiler

⁠動機

なので docker を勉強して dockerFile を作ってみたとさ

⁠参考にしたリポジトリ

⁠サーバへの post 例

⁠リクエスト側
{
    "output": "wasm",
    "files": [
        {
            "type": "cpp",
            "name": "file.cpp",
            "options": "-O3 -std=c++14",
            "src": "int main() { return 0; }"
        }
    ],
    "link_options": ""
}

curl でタスクを投げる

curl -X POST -H 'Content-Type:application/json' -d '{
    "output": "wasm",
    "files": [
        {
            "type": "cpp",
            "name": "file.cpp",
            "options": "-O3 -std=c++14",
            "src": "int main() { return 0; }"
        }
    ],
    "link_options": ""
}' \
https://emscripten-compiler.herokuapp.com/build
⁠レスポンス側
{
    "tasks": [
        {
            "name": "building file.cpp",
            "console": "...",
            "file": "file.cpp",
            "output": "AGFzbQEAAAAAD...",
            "success": true,
        },
        {
            "name": "linking wasm",
            "console": "...",
            "success": true,
        }
    ],
    "output": "AGFzbQEAAAAAD...",
    "jsFile": "Ly8gQ29weXJpZ...",
    "success": true,
    "message": "Success"
}

⁠そのほか

Tag summary

Content type

Image

Digest

sha256:d6c72f55b…

Size

713.5 MB

Last updated

over 1 year ago

docker pull nokotan/emscripten-compiler:4.0.10