I'm working with a multi-stage image which builds and tests the service in the build process and it works fine with the push steps. The only problem is that I don't want to push the image every time a build of the feature
branch is sent to Codeship, so I have this in my codeship-steps.yaml
:
- name: Build API
type: serial
steps:
- name: Build API image
tag: ^(feature)
service: api
command: true
- name: Push staging API image
tag: ^(develop)
type: push
service: api
image_name: gcr.io/project/api
image_tag: "{{.CommitID}}"
registry: https://gcr.io
dockercfg_service: staging-gcr
- name: Push production API image
tag: ^(master)
type: push
service: api
image_name: gcr.io/project/api
image_tag: "{{.CommitID}}"
registry: https://gcr.io
dockercfg_service: production-gcr
and this in codeship-services.yaml
:
api:
build:
image: singularities/codeship-api
dockerfile: api/Dockerfile
Everything should work fine, but the Build API image
step fails because it try to run the service like docker run
. Is there any way to override the entrypoint or tell Codeship to only build the image like docker build
?
In the case of entrypoint scripts, my suggestion would be to create an argument that allows the script to exit successfully.
If you'd like, you can send your steps/services/Dockerfile(s)/entrypoint script to support@codeship.com and we will take a closer look.