Ejemplo n.º 1
0
def get_context():
    console.echo("What's the context for building your docker image?")
    console.echo("For more information on 'docker build context' please see:")
    console.link(
        "https://docs.docker.com/engine/reference/commandline/build/#extended-description"
    )
    return console.input("Build Context (default: '.')", ".")
Ejemplo n.º 2
0
def get_volume():
    return console.input(
        "Enter a volume mapping (e.g. </local_path>:</container_path>)",
        "",
        validate=path_validator,
        invalid_message="Input must contain ':'.",
    )
Ejemplo n.º 3
0
def get_port():
    return console.input(
        "What's the port of it's container?",
        mandatory=True,
        validate=lambda x: x.isnumeric,
        invalid_message="Input must be a number.",
    )
Ejemplo n.º 4
0
def get_target():
    console.echo("What's the target stage for building your docker image?")
    console.echo("For more information on Docker's target stage please see:")
    console.link(
        "https://docs.docker.com/engine/reference/commandline/build/#specifying-target-build-stage---target"
    )
    return console.input("Target (optional)", "")
Ejemplo n.º 5
0
def get_docker_file():
    return console.input("Dockerfile (default: 'Dockerfile')", "Dockerfile")
Ejemplo n.º 6
0
def get_env():
    console.input("Enter env variables (e.g. DEBUG=true)",
                  "",
                  validate=env_validator,
                  invalid_message="Input must contain '='.")
Ejemplo n.º 7
0
def get_command():
    return console.input(
        "What command should be executed on start? (optional)", "")
Ejemplo n.º 8
0
def get_deployment():
    return console.input("What's the name of the deployment?", mandatory=True)