Dockerfile Deploy Example

If you don’t have an app to deploy but would like to try out Dockerfile Deploy, here’s an example.

Create an App

First, create a new app on Aptible.

Note the Git Remote that is provided. Going forward in this article, we’ll refer to it as $GIT_URL.

Initialize a local git repository

Next, create a new empty git repository on your local workstation:

git init test-dockerfile-deploy
cd test-dockerfile-deploy

Then, add a new Dockerfile in the root of the repository, with the following contents:

# Declare a base image:
FROM alpine

# Tell Enclave this app will be accessible over port 80:

# Tell Enclave to run "httpd -f" to start this app:
CMD ["httpd", "-f"]


Finally, deploy to Enclave:

# Commit the Dockerfile
git add Dockerfile
git commit -m "Add a Dockerfile"

# This URL is available in the Aptible Dashboard under "Git Remote".
# You got it after creating your app.
git remote add aptible "$GIT_URL"

# Push to Enclave
git push aptible master

This will deploy a basic image based on Alpine Linux running a HTTP server.