Hey!
I'm trying to use a docker image, built in step 1, as a service in step 2.
The docker image name is defined by the short commit sha, so the docker image url has to be dynamically set.
Is there any way to do this?
Or would I have to define a static image name (e.g. :testing) to use specifically for this pipeline?
pipelines:
branches:
master:
- step:
image: go:something
script:
- # test go code
- # build docker image with tag=short_commit_sha (7chars)
- step:
image: acceptance_tester_image
script:
- # test api server image using service api-server
services:
- api-server
definitions:
services:
api-server:
image:
name: IMAGE/I/BUILT/IN/STEP/ONE:short_commit_sha
options:
docker: true
This feature is currently not supported in Pipelines. There's an open feature request for adding support for environment variables in Docker image names that you can follow if you're interested.
Using Docker Compose is the way to go here! It's an intentional use-case we had for providing Docker in Docker.
The associated issues with Docker in Docker are ones that the Pipelines team has to stay on top of. They (mostly) won't affect you when using Docker inside of Pipelines. So feel free to use Docker as much as you'd like.
Hey Philip, thanks for the details. Good to get confirmation that our current setup should be fine to stick with :)
I'll follow that feature request for now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jonas De Beukelaer ,
Please look into utilizing variables.
Variables in pipelines - especially the default variables.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your answer Edwin.
Unfortunately Pipelines doesn't seem to allow for substituting variables in the image name of a service (even when the image name is surrounded with double quotes)
For now I'm using docker-compose within a step. It's not ideal, and I know some people advise against docker-in-docker, but it seems to be working well for now. This also remove side-effects from having an image uploaded to our registry for testing purposes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.