You are here: Home / presentations / Docker / Payloads

Payloads

by Alan Milligan last modified Mar 15, 2016 08:20 AM

Dockerfile

FROM bastionlinux19:monit
RUN yum install mongodb-server
EXPOSE 27127

Chef

 
knife container docker init --help
the ffi-yajl and yajl-ruby gems have incompatible C libyajl libs and should not be loaded in the same Ruby VM
falling back to ffi which might work (or might not, no promises)
knife container docker init REPO/NAME [options]
    -f, --from [REPO/]IMAGE[:TAG]    The image to use for the FROM value in your Dockerfile
        --server-url URL             Chef Server URL
    -k, --key KEY                    API Client Key
        --[no-]color                 Use colored output, defaults to enabled
    -c, --config CONFIG              The configuration file to use
        --cookbook-path PATH[:PATH]  A colon-seperated path to look for cookbooks
        --defaults                   Accept default values for all questions
        --disable-editing            Do not open EDITOR, just accept the data as is
    -d, --dockerfiles-path PATH      Path to the directory where Docker contexts are kept
    -e, --editor EDITOR              Set the editor to use for interactive commands
        --secret-file SECRET_FILE    A file containing the secret key to use to encrypt data bag item values
    -E, --environment ENVIRONMENT    Set the Chef environment
        --environment-path PATH[:PATH]
                                     A colon-seperated path to look for environments
        --force
    -F, --format FORMAT              Which format to use for output
    -b, --berksfile                  Generate a Berksfile based on the run_list provided
        --include-credentials        Include secure credentials in your Docker image
    -z, --local-mode                 Include and use a local chef repository to build the Docker image
    -u, --user USER                  API Client Username
        --node-path PATH[:PATH]      A colon-seperated path to look for node objects
        --print-after                Show the data after a destructive operation
        --role-path PATH[:PATH]      A colon-seperated path to look for roles
    -r, --run-list RUN_LIST          Comma seperated list of roles/recipes to apply to your Docker image
        --trusted-certs PATH         The path to the directory containing trusted certs
        --validation-client-name NAME
                                     The name of the validation client, typically a client named chef-validator
        --validation-key PATH        The path to the validation key used by the client, typically a file named validation.pem
    -V, --verbose                    More verbose output. Use twice for max verbosity
    -v, --version                    Show chef version
    -y, --yes                        Say yes to all prompts for confirmation
    -h, --help                       Show this message

Boxgrinder

name: bastionlinux19
summary: Standard BastionLinux Core Minimal (no X etc)
version: 19
release: 1
#repos:
#  - name: "local-installer"
#    baseurl: "http://admin:pa55word:10.1.1.200:9080/plone/rpmbuilders/13/RPMS"
#    ephemeral: true
os:
  name: bastionlinux
  version: 19
  password: pa55word
hardware:
  cpus: 1
  memory: 1024
  partitions:
    "/":
      size: 1
# ext4 for /boot with syslinux-extlinux
# seems passwd/rpm/popt isn't installing even though mandatory :(
packages:
  - grub2
  - passwd
  - rpm
  - syslinux-extlinux
  - @core
  - -up2date
  - -chef-client

Packer

{
  "builders":
  [
   {
    "type": "docker",
    "image": "localhost:5000/bastionlinux19",
    "login_server": "localhost",
   }
  ],
  "provisioners":
  [
   {
    "type": "chef-client",
    "server_url": "https://chef.last-bastion.net",
    "validation_key_path": "/etc/chef/validation.pem",
    "node_name": "packer00001",
    "skip_clean_client": true,
    "execute_command": "chef-client",
    "run_list": ["role[mongodb-server]"],
    "validation_client_name": "chef-validator"
   }
  ]
}