Giter Club home page Giter Club logo

Comments (2)

AlexanderCollins avatar AlexanderCollins commented on July 25, 2024

To add anything to the docker image Modify the DockerFile (docker-python-sandbox/container/DockerFile).

You can add any installation commands you require. (for example below I have added python3 to the container)

FROM node:argon

RUN ["adduser",  "--home",  "/usr/src/app", "--system", "sandboxuser"]
RUN ["chown", "-R", "sandboxuser", "/usr/src/app"]
RUN ["chmod", "-R", "u+rwx", "/usr/src/app"]

COPY ./shared /usr/src/app
RUN cd /usr/src/app && npm install

COPY start.sh /
RUN chmod 755 /start.sh

RUN apt-get update

# Install python3
RUN apt-get install python3 -y

CMD ["/start.sh"]

You can also add files and folders in the docker file which can be then utalised after the containers instantiation from the start.sh file, this for example, is how the node server is started.

Then run the ./build.sh command from the "docker-python-sandbox/container/" directory. This will rebuild the "christophetd/docker_sandbox" image. However, if you wish to maintain the functionality of the previous image you can specify a new image name in the build.sh file as seen below:

#!/bin/bash

# Enter your image name below.
IMAGE_NAME="<YOUR IMAGE NAME HERE>"

if [ $# = 1 ]; then
	IMAGE_NAME="$1"
fi

echo "Building image '$IMAGE_NAME'..."
docker build -t $IMAGE_NAME .

FYI:
I will be implementing another argument for the /compile endpoint to allow for multiple language support in the next 10 days or so.

from docker-python-sandbox.

christophetd avatar christophetd commented on July 25, 2024

Thank you @AlexanderCollins! I will add this to the readme.

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.