Build Docker Image #

SetOps chooses not to provide its own Continuous Delivery feature, but to build upon existing, reliable, and trusted tools. This means we don’t build Docker images for you. To deploy your application, you need to build a runnable image first.

Ruby on Rails Applications (Buildpacks)

For a Ruby on Rails application, we recommend Cloud Native Buildpacks for creating the App image. Install the pack CLI first.

Use .env.build for Building an Image

Rails applications will usually need some ENVs during the build step, otherwise, the build will fail. Our best practice so far is to use a .env.build with all required ENVs and use it in your build command as follows:

pack build [MYAPP] --builder heroku/buildpacks:18 --env-file=".env.build"

Required ENVs for the Build Step

We came up with a certain set of required ENVs in our applications. You have to check whether your app has the same ENVs or uses the same logic.

DATABASE_URL=postgres:///
DATABASE_URL_WITHOUT_DB_NAME=postgres:///
RAILS_ENV=staging
SECRET_KEY_BASE=qwer
SEND_MAILS_VIA_SMTP=false
SMTP_FROM=invalid@some.domain
SMTP_URL_HOST=some.domain
USE_HTTP_BASIC_AUTH=false
S3_DATA_URL=s3://ACCESS_KEY:SECRET_KEY@host.invalid/bucket?region=eu-central-1

Docker Image (Dockerfile)

You can use any Docker Image created by others and published in a Docker registry. Just download the Image, tag and push it to your SetOps Docker registry.

Build your own Docker Image

If you’re developing an application, you can create your own Docker Image. To do this with Docker, you need a Dockerfile. Check out Docker’s Image-building best practices and Best practices for writing Dockerfiles.

You can overwrite the last CMD command of your Dockerfile at the SetOps App level. See App’s Command Reference for further information.

Going further #

Read more about deploying an image in the App Deployment Section.