DEV Community

Discussion on: Dockerize your Development Environment

Collapse
 
jefflindholm profile image
Jeff Lindholm

Using powershell:
I just do dev-here node:latest it will download the image mount the current directory to /code in the container and you can edit locally update to git etc. Works for any container that you want, I use it for rust, donet core, node, etc.

function dev-here($lang, $port = 8000) {
    if ($lang -eq '') {
        echo 'usage is dev-here <container name>'
        return
    }
    $args = 'bash'
    if ($lang -eq 'python') {
        $args = "bash"
        # $args = "bash -c 'cd code && pip install -r requirements.txt && bash'"
    }
    $msg = $lang + ' opening port ' + $port + ' running ' + $args
    echo $msg
    echo "docker run --rm -it -e USER=dev -p ${port}:${port} -v ${PWD}:/code $lang $args"
    docker run --rm -it -e USER=dev -p ${port}:${port} -v ${PWD}:/code $lang $args
}
Collapse
 
nialljoemaher profile image
Niall Maher

Nice well then all this article would give you is all the plugins out of the box too. This is a really smart script πŸ’œ