Giter Club home page Giter Club logo

Comments (9)

denisorehovsky avatar denisorehovsky commented on June 26, 2024 1

Exposing socket (docker run -v /var/run/docker.sock:/var/run/docker.sock ...) has actually helped. Everything is working.

As I understand, you don't have plans to support other languages besides python? Would be awesome if the app supported more languages.

from docker-python-sandbox.

christophetd avatar christophetd commented on June 26, 2024 1

Just didn't take the time to complete it. I'll add it to my to do list, and probably add Java, Bash, PHP and C / C++.

from docker-python-sandbox.

christophetd avatar christophetd commented on June 26, 2024

Hey, sorry about the delay. I didn't get a notification for your issue.

You can't ยซ add this sandbox ยป as a third service, as the sandbox is both a Docker image and some Node code that boots and handles the lifecycles of sandbox instances.

Also, note that you probably can't use the library if your application runs inside Docker (since the library needs to start up containers itself).

from docker-python-sandbox.

denisorehovsky avatar denisorehovsky commented on June 26, 2024

Does it possible to implement this using 2 services?

First service - the sandbox itself, where we'd run the code.
Second service - image with node app that would boot the sandbox (first service). Second service would depend on first service.

from docker-python-sandbox.

christophetd avatar christophetd commented on June 26, 2024

I think it might be possible with the following setup:

  • Your application runs inside a container
  • The Docker socket of the host is mounted inside the container (e.g. docker run -v /var/run/docker.sock:/var/run/docker.sock [...])
  • The Docker CLI is installed inside the container (e.g. apt-get update && apt-get install -y docker.io

Example:

user@docker-host:~ $ docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock ubuntu
root@e45b3e6c527b:/# apt-get update && apt-get install -y docker.io
[...]
root@e45b3e6c527b:/# docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
e45b3e6c527b        ubuntu              "/bin/bash"         7 minutes ago       Up 7 minutes                            compassionate_meninsky

After doing that, you'll be able to run Docker commands (e.g. start a container with docker run) from within the container. So I assume the library should theoretically work in this setup. Let me know if that works out!

from docker-python-sandbox.

denisorehovsky avatar denisorehovsky commented on June 26, 2024

Thanks for your help! Actually, I have already tried this but with another library that is similar to yours. Haven't succeeded. I have created an issue there. remoteinterview/compilebox#51

I think, I gonna try to do what you have suggested using this library. I will let you know.

from docker-python-sandbox.

christophetd avatar christophetd commented on June 26, 2024

Sounds good!

from docker-python-sandbox.

christophetd avatar christophetd commented on June 26, 2024

A while ago I started a branch supporting PHP, Python and Java, but I never finished it. What language(s) would be of interest to you?

from docker-python-sandbox.

denisorehovsky avatar denisorehovsky commented on June 26, 2024

The reason why I need to use this library is because I'm building a web app where you can solve programming challenges. The examples of similar sites are codewars or udacity. For me there is no priority, actually. The more, the better.

Why did you drop it? No free time? I'm just thinking that it is useful to have more languages. Not only one python.

from docker-python-sandbox.

Related Issues (15)

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.