Plugin to automatically generate Dockerfile for DanceJL project.
| Build Status |
|---|
Package can be installed with Julia's package manager, either by using Pkg REPL mode (press ]):
pkg> add DanceDocker
or by using Pkg functions
julia> using Pkg; Pkg.add("DanceDocker")Compatibility is with Julia 1.1 and Dance 0.2.1 upward.
Please make sure your project contains a Project.toml file in its root, at same level as dance.jl file.
If testing Docker on localhost, is recommended to set DanceJL setting's :server_host parameter to 0.0.0.0.
Else connections from host to Docker container might not work smoothly.
Invoke terminal in project root directory and:
using DanceDocker
setup()Optionally if you wish to use different Julia version than one used on your machine, one can do so via version kwarg.
For example:
using DanceDocker
setup(;version=1.4)Following section requires Docker to be installed on system.
To build Docker image:
docker build -t <name>:<version> .
where
nameis name of output DOcker image.versionis optional, as Docker will default tag tolatest.
To run built Docker image:
docker run -d -p <host port>:<docker port> <build name>:<build version>
where:
host portanddocker portcorrespond to ports on host and what was specified under Dockerfile respectively. For example:8000:8000.build nameis the name of Docker image, as specified under previous section.build versionis optional, depending on if specified under previous section.
Above command will output a Docker container id. Hence when finished, simply end Docker instance by running:
docker container stop <container id>