How to use dockerfile - 4 common examples

To help you get started, we’ve selected a few dockerfile examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GuLinux / PlanetaryImager / support / docker / docker.py View on Github external
def package(args):
  if args.clean_logs:
    cleanup_logs()
  destination_path = os.path.abspath(args.dest) if args.dest and args.dest != 'none' else None
  filtered_images = filter_images(args.images_filter)
  cmake_defines = args.cmake_define
  cmake_defines.append('CMAKE_BUILD_TYPE=' + args.cmake_build_type)
  for image in filtered_images:
    image.package(code_path, destination_path, args.make_jobs, cmake_defines, stderr=args.stderr, build_directory=args.build_directory, privileged=args.privileged)
    
  print('\nPackages build report:\n')
  build_success = True
  for image in filtered_images:
    build_success &= image.report_build()
  if not build_success:
    print('Some packagescould not be built. Please check the logs directory')
    sys.exit(1)
github GuLinux / PlanetaryImager / support / docker / docker.py View on Github external
def build_images(args):
  if args.clean_logs:
    cleanup_logs()
  create_images()
  filtered_images = filter_images(args.images_filter)
  for image in filtered_images:
    image.build(stderr=args.stderr)
  print('\nImages build report:\n')
  build_success = True
  for image in filtered_images:
    build_success &= image.report_build()
  if not build_success:
    print('Some images could not be built. Please check the logs directory')
    sys.exit(1)
github GuLinux / PlanetaryImager / support / docker / windows.py View on Github external
import shutil
from dockerfile import Dockerfile

class Windows(Dockerfile):
    def __init__(self, arch, linktype='static'):
        self.arch = arch
        name = 'windows-{}'.format(arch)
        mxe_prefix = '{}-w64-mingw32.{}'.format(arch, linktype)
        configuration_file = 'configuration-windows-{}-{}.cmake'.format(arch, linktype)
        self.cmake_binary = mxe_prefix + '-cmake'
        self.os_family = 'windows'

        substitutions = {
            'CMAKE_BIN': self.cmake_binary,
            'MXE_PREFIX': mxe_prefix,
            'ARCH': arch,
            'LINKTYPE': linktype,
            'CMAKE_CACHE_INIT': configuration_file,
            'PACKAGE_SYSTEM_NAME': 'Windows-' + arch,
        }
github GuLinux / PlanetaryImager / support / docker / linux.py View on Github external
import shutil
from dockerfile import Dockerfile


class LinuxBase(Dockerfile):
    def __init__(self, snippet, flavour, version, arch, extra_snippets = [], extra_substitutions={}):
        self.flavour = flavour
        self.version = version
        self.arch = arch
        name = '{}-{}-{}'.format(flavour, version, arch)
        base_image = '{}:{}'.format(flavour, version)
        config_name = '{}-{}'.format(flavour, version)
        self.cmake_binary = 'cmake'
        self.os_family = 'linux'

        if arch != 'x86_64':
            base_image = arch + '/' + base_image

        configuration_file = 'configuration-{}.cmake'.format(config_name)

        substitutions = {

dockerfile

Parse a dockerfile into a high-level representation using the official go parser.

MIT
Latest version published 1 year ago

Package Health Score

59 / 100
Full package analysis