docker:build¶usage: strong-opx docker:build [-h] [--name NAME] [--ssh] [--ssh-key SSH_KEY] [--push] [--build-arg BUILD_ARGS [BUILD_ARGS ...]] [--tag DOCKER_TAGS [DOCKER_TAGS ...]] [--project PROJECT] [--env ENVIRONMENT]
[-v {0,1,2,3}] [--traceback]
path
Docker build context
show this help message and exit
Image name. Default: directory name
Run ssh-agent and add ssh key to the build context
When –ssh is used, use this key instead of the default
Push built image to ECR
Additional build args to docker-build (values will be auto-resolved from stored vars)
Additional tags to apply. latest tag will always be included
Select project by its name. If missing, strong-opx will attempt to auto-select project based on current working directory and its parents and looking for presence of configured project
Environment name. If project has only one environment that will be auto selected
Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very verbose output.
Raise instead of handling known exceptions
See also
All built images when pushed to ECR will be tagged with latest, <environment>-latest alongside a generated
unique tag of format: <environment>-<revision>.<vcs-head-sha-hash>. The <revision> is an auto-incrementing
number unique to the environment. <vcs-head-sha-hash> is the SHA-1 hash of the HEAD commit in the VCS repository
and will only be included in case of git repository.
Note
If a project has two environments within the same AWS region and the --name value is the same for
both environments, using latest tag can cause conflicts.
For example, if a project had two environments, staging and development, in the us-east-1
region of the same AWS account and the following commands were run:
strong-opx docker-build ./my-project --env=staging --push
strong-opx docker-build ./my-project -env=development --push
Both commands would push the newly-built Docker image to the same [AWS account]/my-project ECR repository
overriding latest tag.
To avoid this use <environment>-latest tag instead of latest tag.