Beispiel #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: '.')", ".")
Beispiel #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 ':'.",
    )
Beispiel #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.",
    )
Beispiel #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)", "")
Beispiel #5
0
def get_docker_file():
    return console.input("Dockerfile (default: 'Dockerfile')", "Dockerfile")
Beispiel #6
0
def get_env():
    console.input("Enter env variables (e.g. DEBUG=true)",
                  "",
                  validate=env_validator,
                  invalid_message="Input must contain '='.")
Beispiel #7
0
def get_command():
    return console.input(
        "What command should be executed on start? (optional)", "")
Beispiel #8
0
def get_deployment():
    return console.input("What's the name of the deployment?", mandatory=True)