Defining Services

There are two ways to provide Enclave with the list of Services for your App:

Implicit Service (CMD)

If your App’s Image includes a CMD or ENTRYPOINT declaration, a single implicit cmd service will be created for it when you deploy your App.

Containers for the implicit cmd Service will execute the CMD your image defines (if you have an ENTRYPOINT defined, then the CMD will be passed as arguments to the ENTRYPOINT).

This corresponds to Docker’s behavior when you use docker run, so if you’ve started Containers for your image locally using docker run my-image, you can expect Containers started on Enclave to behave identically.

Typically, the CMD declaration is something you’d add in your Dockerfile, like so:

FROM alpine:3.5
ADD . /app
CMD ["/app/run"]


Using an implicit service is recommended if your App only has one Service.

Explicit Services (Procfiles)


As you’d expect, no Implicit Service (CMD) will be created for your App when you use Explicit Services.

If your App needs multiple Services, you can provide Enclave with a Procfile that indicates which services should be started when your App is deployed.

Broadly speaking, the Procfile contains a list of declarations, mapping service names to the commands the Containers for this service should run:

web: /app/run-web
worker: /app/run-worker

When your App Containers start, they’ll execute the command defined in your Procfile.

However, this command will be interpreted using a shell (/bin/sh, specifically). This has two implications:

First, this means you can use shell syntax in a Procfile line, like this:

web: /app/prepare && /app/run-web "$ENVIRONMENT"

Second, this means a shell will be running as PID 1 in container. Occasionally, this may not desirable.


Review Procfiles For Procfile syntax and examples.