ismell / docker-registry-cookbook Goto Github PK
View Code? Open in Web Editor NEWChef Cookbook to install the dotCloud Docker Registry
Chef Cookbook to install the dotCloud Docker Registry
Hi,
I am trying to create an AWS node with chef-provisioning and this cookbook. When the cookbook runs using the example docker-registry role I receive the error below.
Chef::Mixin::Template::TemplateError (undefined method `attribute?' for "10.23.1.19":String) on line #8:
6: <% end -%>
7: <% @hosts.each do |node| %>
8: server <%= node.attribute?('cloud') ? node['cloud']['local_ipv4'] : node['ipaddress'] %>:<%= @resource.application_port %>;
9: <% end %>
10: }
I looked in the README for the application_nginx cookbook and it says that hosts: the set of hosts at which to point the load balancer. This overrides the application_server_role parameter to allow search-free static definition as an Array of strings (IP or hostname).
Since the documentation implies this should be a string and it is I am not sure why it is treated as a node object in the template. Presumably this must be working for other people so I am somewhat confused?
This cookbook only works with the application cookbook up to v3.0.0 due to a major change in v4.0.0 (see COOK-3360).
The commit message says: "all cookbooks that depend on this one must be updated".
This is especially causing a NameError: uninitialized constant Chef::Resource::ApplicationBase
as ApplicationBase no more exists on v4 and up.
Therefore the constraint in the metadata.rb is wrong:
depends 'application', '<= 3.0.0'
Hi!
I stumbled upon your cookbook, and I'm planning to use it. If you have a couple minutes, would you mind uploading the most recent version to the Opscode supermarket, so I don't need to fetch from your github page in my Berksfile?
Thanks!
The cookbook can successfully deploy docker-registry 0.6.8 but it breaks on versions greater than 0.6.9 (included). Versions 0.8x have another issue with the requirements.txt being gone, but version 0.7.x should be deployable with this cookbook.
If I set the node['docker-registry']['revision']
to 0.6.9 or to 0.7.3 the chef-run will fail because the docker-registry supervisor service won't start. Checking at the log, we find that the reason is "ImportError: no module named wsgi".
Indeed, the wsgi.py from 0.6.8 is now gone and has been replaced with docker_registry/wsgi.py.
My Python skills are limited, but I assume that gunicorn should be started with docker_wsgi:application
instead of wsgi:application
argument (with possible tweaks to the python paths).
I would happily do a pull request if I had free time to investigate, which won't be in the coming 2 weeks.
I cant find a reference to this in the docker registry code anywhere?
https://github.com/ismell/docker-registry-cookbook/blob/master/templates/default/config.yml.erb#L6
I pulled this cookbook from the Supermarket, and the config file template that comes down looks like this:
# The `common' part is automatically included (and possibly overriden by all
# other flavors)
common:
storage: <%= @storage %>
storage_path: <%= @storage_path %>
secret_key: <%= @secret_key %>
<% if @storage == "s3" -%>
s3_access_key: <%= @s3_access_key %>
s3_secret_key: <%= @s3_secret_key %>
s3_bucket: <%= @s3_bucket %>
<% end %>
standalone: <%= @standalone %>
<% unless @standalone %>
index_endpoint: <%= @index_endpoint %>
<% end %>
# This is the default configuration when no flavor is specified
dev:
loglevel: debug
prod:
loglevel: warn
However, in this repo it looks like this:
# The `common' part is automatically included (and possibly overriden by all
# other flavors)
common:
storage: <%= @storage %>
storage_path: <%= @storage_path %>
secret_key: <%= @secret_key %>
<% if @storage == "s3" -%>
s3_access_key: <%= @s3_access_key %>
s3_secret_key: <%= @s3_secret_key %>
s3_bucket: <%= @s3_bucket %>
boto_bucket: <%= @s3_bucket %>
<% end %>
standalone: <%= @standalone %>
<% unless @standalone %>
index_endpoint: <%= @index_endpoint %>
<% end %>
# This is the default configuration when no flavor is specified
dev:
loglevel: debug
prod:
loglevel: warn
Tried this on a new EC2 instance and it failed with the following output:
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '128'
---- Begin output of git checkout -b deploy ab2a346ae246b65eecc4e68bb91a2ec25ea7756e ----
STDOUT:
STDERR: fatal: reference is not a tree: ab2a346ae246b65eecc4e68bb91a2ec25ea7756e
---- End output of git checkout -b deploy ab2a346ae246b65eecc4e68bb91a2ec25ea7756e ----
Ran git checkout -b deploy ab2a346ae246b65eecc4e68bb91a2ec25ea7756e returned 128
I needed to add
package "libssl-dev"
on ubuntu 14.04 to get the recipe docker-registry::application_server
working, otherwise it fails during the pip install
.
Hope it helps !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.