BOSH release for Diego Docker Cache
This BOSH release doubles as a $GOPATH
. It will automatically be set up for
you if you have direnv installed.
# fetch release repo
mkdir -p ~/workspace
cd ~/workspace
git clone https://github.com/cloudfoundry-incubator/diego-docker-cache.git
cd diego-docker-cache/
# automate $GOPATH and $PATH setup
direnv allow
# initialize and sync submodules
./scripts/update
If you do not wish to use direnv, you can simply source
the .envrc
file in the root
of the release repo. You may manually need to update your $GOPATH
and $PATH
variables
as you switch in and out of the directory.
-
Follow the instructions in Diego Release and install CF
-
When generating the Diego's manifest (step 9) use the following set of files instead:
cd ~/workspace/diego-release ./scripts/generate-deployment-manifest \ ~/workspace/diego-docker-cache-release/stubs-for-diego-release/bosh-lite-property-overrides.yml \ manifest-generation/bosh-lite-stubs/instance-count-overrides.yml \ manifest-generation/bosh-lite-stubs/persistent-disk-overrides.yml \ manifest-generation/bosh-lite-stubs/iaas-settings.yml \ manifest-generation/bosh-lite-stubs/additional-jobs.yml \ manifest-generation/bosh-lite-stubs/release-versions.yml \ ~/workspace/cf-release/bosh-lite/deployments \ > ~/workspace/diego-release/bosh-lite/deployments/diego.yml bosh deployment ~/workspace/diego-release/bosh-lite/deployments/diego.yml
-
Deploy Diego:
bosh create release --force bosh -n upload release bosh -n deploy
-
Generate and target Diego Docker Cache's manifest:
cd ~/workspace/diego-docker-cache-release ./scripts/generate-bosh-lite-manifest bosh deployment ~/workspace/diego-docker-cache-release/bosh-lite/deployments/docker-cache.yml
-
Deploy the Docker Cache:
bosh create release --force bosh -n upload release bosh -n deploy
You can configure the Docker Registry backend storage in property-overrides.yml. Here is what you have to include for each supported storage type:
This is the default storage type. You can simply omit the property overrides or explicitly add:
docker_registry:
storage:
name: filesystem
docker_registry:
storage:
name: s3
s3:
bucket: <bucket name>
accesskey: <access key>
secretkey: <secret key>
region: <region name, i.e. us-east-1>
Save the property changes and then generate the manifest and deploy the Diego Docker Cache release.
Docker Registry can be configured to use TLS for secure communication. To do this:
-
Obtain a certificate and key. This can be done with OpenSSL:
openssl genrsa -out server.key 1024 openssl req -new -key server.key -out server.csr openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
-
Edit property-overrides.yml. You have to add the generated certificate and key:
docker_registry: tls: enabled: true certificate: | -----BEGIN CERTIFICATE----- ... content of server.crt file ... -----END CERTIFICATE----- key: | -----BEGIN RSA PRIVATE KEY----- ... content of server.key file ... -----END RSA PRIVATE KEY-----
Save the property changes and then generate the manifest and deploy the Diego Docker Cache release.
See docker-cache-acceptance-tests
-
Install CF CLI v6.10.0+ (or follow the guide in Migrating to Diego)
-
Install
diego-beta
CLI Plugincf add-plugin-repo CF-Community http://plugins.cloudfoundry.org/ cf install-plugin Diego-Beta -r CF-Community
-
Login to CF
cf api --skip-ssl-validation api.10.244.0.34.xip.io cf auth admin admin
-
Push your docker application
cf docker-push <application_name> <docker_image> --no-start
-
Enable caching by setting
DIEGO_DOCKER_CACHE
boolean environment variablecf set-env <application_name> DIEGO_DOCKER_CACHE true
-
Start the application:
cf start <application_name>