Skip to content

Commit

Permalink
- Enforce Chef Server 11 (instead of lastest Chef Server version)
Browse files Browse the repository at this point in the history
- Reduced image size (From 1.319GB to 1.025GB)
  • Loading branch information
c-buisson committed Mar 2, 2017
1 parent 61ddbb1 commit 31452c9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ FROM ubuntu:14.04
MAINTAINER Clement Buisson <clement.buisson@gmail.com>
#This is a fork of base/chef-server

RUN apt-get update
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get install -yq wget curl
RUN wget --content-disposition "http://www.opscode.com/chef/download-server?p=ubuntu&pv=12.04&m=x86_64&v=latest&prerelease=false&nightlies=false"
RUN dpkg -i chef-server*.deb
RUN apt-get update && \
apt-get install -yq --no-install-recommends wget curl && \
wget --no-check-certificate --content-disposition "http://www.opscode.com/chef/download-server?p=ubuntu&pv=14.04&m=x86_64&v=11&prerelease=false&nightlies=false" && \
dpkg -i chef-server*.deb && \
rm chef-server*.deb && \
apt-get remove -y wget && \
rm -rf /var/lib/apt/lists/*

RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -sf /bin/true /sbin/initctl
Expand Down
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
# chef-server

chef-server is running Chef server 11 on an Ubuntu Trusty 14.04 LTS
chef-server is running Chef Server 11 in a Ubuntu Trusty 14.04 LTS container.
Image Size: 1.025 GB

This is a fork of: [base/chef-server](https://registry.hub.docker.com/u/base/chef-server/).

## Environment
Chef is running over HTTPS/443 by default. You can however change that to another port by updating the `CHEF_PORT` variable and the expose port `-p`.

You will need to use Chef 11.X in order to be able to use Knife.
Check Knife's version:
```bash
cbuisson@t530:~# knife -v
Chef: 11.16.4
```
*If you have Chef 12 installed on your Docker server, you will need to use* `knife ssl fetch` *in order to get the SSL certificates from the container. Don't forget to update `chef_server_url` with the container ID in knife.rb!*

## Usage
*With log output:*

Expand All @@ -23,7 +32,19 @@ $ docker run --privileged -e CHEF_PORT=443 --name chef-server -d -p 443:443 cbui
Once the Chef server is configured, you can download the Knife admin keys here:

```
$ curl -Ok https://IP:CHEF_PORT/knife_admin_key.tar.gz
$ curl -Ok https://IP_HOST:CHEF_PORT/knife_admin_key.tar.gz
```

Then un-tar that archive and point your knife.rb to the `admin.pem` and `chef-validator.pem` files.

*knife.rb* example:
```bash
log_level :info
log_location STDOUT
cache_type 'BasicFile'
node_name 'admin'
client_key '/home/cbuisson/.chef/admin.pem'
validation_client_name 'chef-validator'
validation_key '/home/cbuisson/.chef/chef-validator.pem'
chef_server_url 'https://IP_HOST:CHEF_PORT'
```

0 comments on commit 31452c9

Please sign in to comment.