Similar problem here, the image (which I can verify was updated by running docker images) produced during my build step is ignored in the test step.
types:
- build
- test
# Update the Docker container used for running tests. This is important to
# prevent unecessary failures when for example salt/my-project.sls is changed.
update-container:
type: build
tags:
- shell
script:
- cd salt; docker build -t my-project .
# Do tests.
test-app:
type: test
tags:
- docker
script:
- ./run-tests.sh
I got in touch with the Gitlab support team. Here is [the relevant part of] the response:
I heard from our team. Currently it is not possible to pass artifacts between builds, but it is on the pipeline, so this feature will be added in the future. it is, however, possible to move the generated docker image outside of the temporary folder where they are generated. This should allow you to reuse them.
If git clone is used it will force docker build to rebuild all images, in most cases.
Also, please make sure that you are able to run the following command on your docker container:
docker run myproject rbenv
If it’s not working, the environment PATH should be fixed to make the above command to run. This may happen because builds that are run in docker containers are run in non-login mode. Which is different from the usually used docker interactive mode docker run -it myproject
Agree 100%. It’s good to know it’s on the roadmap, though they weren’t exactly forthcoming with a timeline, but it should become clear before long: Almost Everything We Do Will Be Open