The Kubernetes-native platform (v2).
The Package manager for Kubernetes.
The Kubernetes-native Service Broker.
Drycc supports deploying applications via an existing Docker Image. This is useful for integrating Drycc into Docker-based CI/CD pipelines.
Start by cloning an example application:
$ git clone https://github.com/drycc/example-dockerfile-http.git $ cd example-dockerfile-http
Next use your local
docker client to build the image and push
it to DockerHub.
$ docker build -t <username>/example-dockerfile-http . $ docker push <username>/example-dockerfile-http
In order to deploy Docker images, they must conform to the following requirements:
EXPOSEdirective to expose exactly one port.
CMDdirective to define the default process that will run within the container.
Note that if you are using a private registry of any kind (
gcr or other) the application environment must include a
$PORT config variable that matches the
EXPOSE'd port, example:
drycc config:set PORT=5000. See Configuring Registry for more info.
drycc create to create an application on the controller.
$ mkdir -p /tmp/example-dockerfile-http && cd /tmp/example-dockerfile-http $ drycc create example-dockerfile-http --no-remote Creating application... done, created example-dockerfile-http
For all commands except for
drycc create, the
drycc client uses the name of the current directory
as the app name if you don't specify it explicitly with
drycc pull to deploy your application from DockerHub or
a public registry.
$ drycc pull <username>/example-dockerfile-http:latest Creating build... done, v2 $ curl -s http://example-dockerfile-http.local3.dryccapp.com Powered by Drycc
Because you are deploying a Docker image, the
cmd process type is automatically scaled to 1 on first deploy.
drycc scale cmd=3 to increase
cmd processes to 3, for example. Scaling a
process type directly changes the number of Containers
running that process.
To deploy Docker images from a private registry or from a private repository, use
to attach credentials to your application. These credentials are the same as you'd use when running
docker login at your private registry.
To deploy private Docker images, take the following steps:
drycc registry:set username=<the-user> password=<secret> -a <application-name>
drycc pullas normal, against an image in the private registry
When using a GCR.io Long Lived Token, the JSON blob will have to be compacted first using a
tool like jq and then used in the password field in
drycc registry:set. For the username, use
_json_key. For example:
drycc registry:set username=_json_key password="$(cat google_cloud_cred.json | jq -c .)"
When using a private registry the docker images are no longer pulled into the Drycc Internal Registry via
the Drycc Workflow Controller but rather is managed by Kubernetes. This will increase security and overall speed,
however the application
port information can no longer be discovered. Instead the application
port information can be set via
drycc config:set PORT=80 prior to setting the registry information.