Skip to content

Instantly share code, notes, and snippets.

vagrant@chef-container-ubuntu-1204:~/omnibus-chef$ bundle exec omnibus build chef-container
[Omnibus] W | DEPRECATED: Omnibus.root. Please use Omnibus.project_root instead.
[Omnibus] W | DEPRECATED: Omnibus.root. Please use Omnibus.project_root instead.
W | The `replaces` project DSL statement should never equal the `package_name` or
`name` of a project. The `replaces` option should only be used when you have
published an artifact under one name and then later renamed the packages that
you are publishing and you must obsolete the old package name. For example this
is used, correctly, in chef-client builds:
name 'chef'
vagrant@chef-container-ubuntu-1204:~/omnibus-chef$ bundle exec omnibus build chef-container --override append_timestamp:true
[Omnibus] W | DEPRECATED: Omnibus.root. Please use Omnibus.project_root instead.
[Omnibus] W | DEPRECATED: Omnibus.root. Please use Omnibus.project_root instead.
W | The `replaces` project DSL statement should never equal the `package_name` or
`name` of a project. The `replaces` option should only be used when you have
published an artifact under one name and then later renamed the packages that
you are publishing and you must obsolete the old package name. For example this
is used, correctly, in chef-client builds:
name 'chef'
#
# Copyright:: Copyright (c) 2014 Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
### Keybase proof
I hereby claim:
* I am tduffield on github.
* I am tomduffield (https://keybase.io/tomduffield) on keybase.
* I have a public key whose fingerprint is EA7A 48A2 726E 6C89 B3CB BC4D 654E F8FD 4A6B 8C3F
To claim this, I am signing this object:
@tduffield
tduffield / gist:74c78a2399b1e8dad0ec
Created November 19, 2014 19:34
docker-api rspec failures
Failures:
1) Docker::Container#top returns the top commands as an Array
Failure/Error: expect(top.first.keys).to eq %w(UID PID PPID C STIME TTY TIME CMD)
expected: ["UID", "PID", "PPID", "C", "STIME", "TTY", "TIME", "CMD"]
got: ["PID", "USER", "COMMAND"]
(compared using ==)
# ./spec/docker/container_spec.rb:117:in `block (3 levels) in <top (required)>'
@tduffield
tduffield / gist:64009af40e956e406237
Created November 19, 2014 19:44
docker-api failures when running Docker inside Docker
Failures:
1) Docker::Container#run when the Container's command does not return status code of 0 raises an error
Failure/Error: expect { run_command }
expected Docker::Error::UnexpectedResponseError but nothing was raised
# ./spec/docker/container_spec.rb:395:in `block (4 levels) in <top (required)>'
2) Docker::Image#push when there are no credentials still pushes
Failure/Error: expect { image.push }.to_not raise_error
expected no Exception, got #<Docker::Error::ServerError: Invalid registry endpoint https://localhost:5000/v1/: Get https://localhost:5000/v1/_ping: dial tcp 127.0.0.1:5000: connection refused. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry localhost:5000` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/localhost:5000/ca.crt
@tduffield
tduffield / gist:dbb5695355c730330ca0
Created November 20, 2014 03:08
docker registry run output
root@dd33ec8955dd:/docker-api# docker run --privileged -p 5000:5000 registry
2014-11-20 01:14:04 [1] [INFO] Starting gunicorn 19.1.0
2014-11-20 01:14:04 [1] [INFO] Listening at: http://0.0.0.0:5000 (1)
2014-11-20 01:14:04 [1] [INFO] Using worker: gevent
2014-11-20 01:14:04 [13] [INFO] Booting worker with pid: 13
2014-11-20 01:14:04 [14] [INFO] Booting worker with pid: 14
2014-11-20 01:14:04 [15] [INFO] Booting worker with pid: 15
2014-11-20 01:14:04 [22] [INFO] Booting worker with pid: 22
2014-11-20 01:14:04 [1] [INFO] 4 workers
20/Nov/2014:01:14:04 +0000 WARNING: Cache storage disabled!
@tduffield
tduffield / example request
Last active August 29, 2015 14:10
HTTP interaction against Boot2Docker to create Exec instance
resp = conn.post('/exec/350/start', nil, :body => {}.to_json)
=> "\u0002\u0000\u0000\u0000\u0000\u0000\u0000,No such exec instance '350' found in daemon\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000ZError starting exec command in container 350: No such exec instance '350' found in daemon\n"
resp = conn.post('/containers/known404/exec', nil, :body => {}.to_json)
Docker::Error::NotFoundError: Expected([200, 201, 202, 203, 204, 304]) <=> Actual(404 Not Found)
---
http_interactions:
- request:
method: post
uri: https://192.168.59.103:2376/v1.15/containers/create
body:
encoding: UTF-8
string: '{"Cmd":["sleep","60"],"Image":"debian:wheezy"}'
headers:
User-Agent:
@tduffield
tduffield / readme.md
Created July 29, 2015 21:40
Readme for Ooyala Cookbook

ooyala-delivery-demo

This cookbook represents an example of how to upload a cookbook to multiple Chef Servers. We accomplish this by leveraging the delivery_chef_cookbook resource made available from delivery-sugar. For information on how to use delivery_chef_cookbook, please check out the documentation here.

This cookbook lays down the necessary knife environments on a per-project basis by storing the client keys in chef-vault and calling them from there. You can also lay the knife