Skip to content

avenga/dockerfiles

Repository files navigation

Avenga dockerfiles

Build Status

Public Avenga dockerfiles intended to serve as base images for our projects.

Opinionated conventions and best practices:

  • use docker in docker itself to make sure to use the same docker version when building and pushing
  • only build and push images that changed; based on specific git diff command

Images

Build

Build all docker images that changed:

make build

Build specific docker images:

make build -e IMAGES="wordpress"

Push

Push all docker images that changed:

make push

Push specific docker images:

make push -e IMAGES="wordpress"

Test

All tests are bats-tests. They reside in a directory inside the image direcotry named tests/. There can be two types of tests. Pure Bats-tests or a Bash script called test.sh.

test.sh

If a script called test.sh resides inside <imagename>/tests it is executed. test.sh is necessary when some preparations have to be made to run the Bats tests. Thus first all preparations are run and then the Bats tests. If there are any Bats tests they won't be executed by the test itself. Exceution must be done inside test.sh.

One example is an image which delivers a networked service like a HTTP-server. This server is tested via HTTP. Thus a functioning network is necessary and the prep-code takes care of this. The tests of the Wordpress image leverage this.

Bats tests

All Bats files under <imagename>/tests are executed.

Development

  • Branches are always created from the master
  • Branch naming: <image>/<short description of the change>
  • PRs have the same name as the branch
  • per PR ony small changes
  1. update master
  2. create a branch from master
  3. make your changes
  4. build and test your changes
  5. commit, push and create PR
  6. Review required