Git Product home page Git Product logo

vscode-container-wasm-gcc-example's Introduction

gcc container on VS Code

Example of https://github.com/ktock/vscode-container-wasm

  1. Open this repo on github.dev : https://github.dev/ktock/vscode-container-wasm-gcc-example?vscode-coi=on (if using . shortcut key, you need to add ?vscode-coi=on query manually in the URL)
  2. Install ktock.container-wasm extension.
  3. Run > Run Container On Browser in the command pallete. Then the container will be launched with the Terminal (can take some time to start the container)

Container on browser

In the container, the workspace is mounted at /workspace and you can compile and run hello.c file.

root@localhost:/# ls /workspace/
LICENSE  hello.c
root@localhost:/# gcc /workspace/hello.c
root@localhost:/# ./a.out
Hello, world!

NOTE: it might take some time to complete compiling the code.

Container

This will launch the following container.

FROM debian:sid-slim
RUN apt-get update && apt-get install -y gcc

The workspace is visible at /workspace in the container.

Note that this extension doesn't require remote container. This extension downloads the Wasm image converted from the container and runs it in the WebAssembly VM in your browser.

HTTP(S) networking is available in the contaienr with restrictions by the browser (CORS-restricted and no control over Forbidden headers). (see also the project README).

You can customize settings.json if you want to load other containers.

FAQ

"SharedArrayBuffer is not defined" error occurs when launching the container

To make SharedArrayBuffer available, please add ?vscode-coi=on query to the URL and reload the page.

More info about the container

vscode-container-wasm-gcc-example's People

Contributors

ktock avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.