How do you create a docker container automatically with a git download and automatic start with python?

  docker, git, python-3.x

Hey
I try to automatical creat a docker container with this code

    clone = 'git clone ' + link
    print(clone)
    run = 'python3 ' + dateiname
    print(run)
    dockers = docker.from_env()
    userdocker = dockers.containers.run(
        image='python:3-alpine', stdout=True, name=author_name, command=[clone, run])
    log = userdocker.logs()
    print(log)

but I aslo get this error
Internal Server Error ("OCI runtime create failed: container_linux.go:370: starting container process caused: exec: "git clone ": stat git clone : no such file or directory: unknown")

Is ther any way to fix this or is there another way?

Source: Docker Questions

LEAVE A COMMENT