Build and push image to a remote Docker registry.
Docker Push step uses Docker registries connected within Microtica Portal to obtain access credentials. If a specific registry name is not provided the default one will be used.
Credentials for the specified remote Docker registry will be automatically provided by Microtica.
The display name of the step.
The type of the Microtica built-in step. Should always be docker-push for this type of step.
The name of the image that will be created and pushed in the remote Docker registry. When specifying the image name make sure that it is aligned with registry provider naming conventions, otherwise the pipeline execution will fail.
The tag identifier for the image being pushed. Default: latest
Path to the Dockerfile to be used to build the image. Default: ./Dockerfile
The name identifier of the Docker registry within Microtica. Default: default registry from the Microtica Portal
Path to the context for the Docker build command. Default: . docker build -t <image_name> .
Arguments to be applied in docker build command.
Enable image vulnerability scanning. Default: true
In the following example we define a pipeline that pulls the code from a Git repository then builds and pushes an image on Docker registry with the name dockerhub.
The image pushed on the remote registry will be named as my-app and tagged with v0.1.0.
The following example extends the previous one by adding custom path to the Dockerfile. In addition, we have to set the Docker build context to make sure that build command will run in context of app/build path.
If you need to provide additional arguments during Docker build-time you can do that by specifying the arguments in build_arguments step property. The arguments will be simply applied in the docker build command.
The build arguments can then be used in the Dockerfile file:
Using local variables
You may also use the --build-arg flag without a value, in which case the value from the local environment will be propagated into the Docker container being built.
Arguments allow you to pass the build-time variables that are accessed like regular environment variables in the RUN instruction of the Dockerfile. Also, these values don’t persist in the intermediate or final images like ENV values do.
You must add --build-arg for each build argument.