docker-image-from-folder

Description

n/a

Variables

Name Type Default Description

base_path

string --

The path where the Dockerfile and build context live. Required

name

string --

The name of the image. Required

force

boolean False

Whether to force the build to be done, even if an image with that name exists already.

nocache

boolean False

Whether to use cache when building an image.

Code

args:
  base_path:
    doc:
      short_help: The path where the Dockerfile and build context live.
    type: string
    required: true
    cli:
      param_type: argument
  name:
    doc:
      short_help: The name of the image.
    type: string
    required: true
  force:
    doc:
      short_help: Whether to force the build to be done, even if an image with that
        name exists already.
    type: boolean
    default: false
    required: false
  nocache:
    doc:
      short_help: Whether to use cache when building an image.
    type: boolean
    default: false
    required: false
    cli:
      param_decls:
      - --no-cache
frecklets:
- docker-service
- frecklet:
    name: docker_image
    type: ansible-module
    desc:
      short: "build docker image '{{:: name ::}}'"
      long: |
        "Build a docker image with the name '{{:: name ::}}' from the Dockerfile in folder '{{:: base_path ::}}'
    resources:
      python-package:
      - docker
  vars:
    build:
      path: '{{:: base_path ::}}'
      nocache: '{{:: nocache ::}}'
    name: '{{:: name ::}}'
    source: build
    force: '{{:: force ::}}'
frecklecute docker-image-from-folder --help

Usage: frecklecute docker-image-from-folder [OPTIONS] BASE_PATH

  n/a

Options:
  --name NAME           The name of the image.  [required]
  --force / --no-force  Whether to force the build to be done, even if an
                        image with that name exists already.
  --no-cache            Whether to use cache when building an image.
  --help                Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.docker_image_from_folder.DockerImageFromFolder
#


from dataclasses import dataclass
from pyckles import AutoPycklet
from typing import *    # noqa

@dataclass
class DockerImageFromFolder(AutoPycklet):
    """No documentation available.

       Args:
         base_path: The path where the Dockerfile and build context live.
         force: Whether to force the build to be done, even if an image with that name exists already.
         name: The name of the image.
         nocache: Whether to use cache when building an image.

    """

    FRECKLET_ID = "docker-image-from-folder"

    base_path: str = None
    force: bool = None
    name: str = None
    nocache: bool = None


    def __post_init__(self):
        super(DockerImageFromFolder, self).__init__(var_names=["base_path", "force", "name", "nocache"])


frecklet_class = DockerImageFromFolder
# -*- coding: utf-8 -*-


#
# module path: pycklets.docker_image_from_folder.DockerImageFromFolder
#


from pyckles import AutoPycklet

class DockerImageFromFolder(AutoPycklet):
    """No documentation available.

       Args:
         base_path: The path where the Dockerfile and build context live.
         force: Whether to force the build to be done, even if an image with that name exists already.
         name: The name of the image.
         nocache: Whether to use cache when building an image.

    """

    FRECKLET_ID = "docker-image-from-folder"

    def __init__(self, base_path=None, force=None, name=None, nocache=None):

        super(DockerImageFromFolder, self).__init__(var_names=["base_path", "force", "name", "nocache"])
        self._base_path = base_path
        self._force = force
        self._name = name
        self._nocache = nocache

    @property
    def base_path(self):
        return self._base_path

    @base_path.setter
    def base_path(self, base_path):
        self._base_path = base_path

    @property
    def force(self):
        return self._force

    @force.setter
    def force(self, force):
        self._force = force

    @property
    def name(self):
        return self._name

    @name.setter
    def name(self, name):
        self._name = name

    @property
    def nocache(self):
        return self._nocache

    @nocache.setter
    def nocache(self, nocache):
        self._nocache = nocache



frecklet_class = DockerImageFromFolder