Core Concepts
...
Pipelines
Steps
Docker Push
7min
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 registry credentials credentials for the specified remote docker registry will be automatically provided by microtica syntax microtica yaml steps step name type docker push title build and push docker image image name microtica/my app tag latest registry my registry parameter description required title the display name of the step no type the type of the microtica built in step should always be docker push for this type of step yes image name 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 yes tag the tag identifier for the image being pushed default latest no dockerfile path to the dockerfile to be used to build the image default /dockerfile no registry the name identifier of the docker registry within microtica default default registry from the microtica portal no build context path to the context for the docker build command default docker build t \<image name> no build arguments arguments to be applied in docker build command no scan enable image vulnerability scanning default true no build and push an image 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 microtica yaml steps clone title clone my source code from git type git clone pushdockerimage type docker push image name microtica/my app tag v0 1 0 registry dockerhub custom dockerfile path and build context 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 microtica yaml steps clone title clone my source code from git type git clone pushdockerimage type docker push image name microtica/my app tag v0 1 0 registry dockerhub dockerfile app/build/dockerfile build context app/build docker build arguments 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 microtica yaml steps clone title clone my source code from git type git clone pushdockerimage type docker push image name microtica/my app tag v0 1 0 registry dockerhub build arguments " build arg mic pipeline id build arg package url=https //example com" the build arguments can then be used in the dockerfile file from node\ latest arg mic pipeline id arg port run curl ${package url} run echo ${mic pipeline id} cmd \["node", "index js"] 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 lifetime 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