docker-compose-buildkite-plugin icon indicating copy to clipboard operation
docker-compose-buildkite-plugin copied to clipboard

invalid tag name causing Docker daemon connection errors

Open jufemaiz opened this issue 5 years ago • 2 comments

A tag name for a docker image has a requirement in terms of its composition.

A tag name must be valid ASCII and may contain lowercase and uppercase letters, digits, underscores, periods and dashes. A tag name may not start with a period or a dash and may contain a maximum of 128 characters. Ref: https://docs.docker.com/engine/reference/commandline/tag/

Setting the image-name as follows:

image-name: "-bob"

causes the following error during a build:

Building services app | 1s
-- | --
  | $ docker-compose -f docker-compose.yml -f docker-compose.test-ci.yml -p buildkiteHASH -f docker-compose.buildkite-BUILD_ID-override.yml build --pull app app
  | Building app
  | ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
  |  
  | If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
  | 🚨 Error: The command exited with status 1

docker-compose.buildkite-BUILD_ID-override.yml

version: '3'
services:
  app:
    image: ACCOUNT_ID.dkr.ecr.REGION.amazonaws.com/ECR_REPO_NAME:-test

BUILDKITE_AGENT_META_DATA_AWS_AMI_ID="ami-019339aa0eb3bbd88" BUILDKITE_AGENT_META_DATA_AWS_INSTANCE_TYPE="m5.large" BUILDKITE_AGENT_META_DATA_BUILDKITE_AWS_STACK="v4.3.4" BUILDKITE_AGENT_META_DATA_DOCKER="19.03.1"

jufemaiz avatar Aug 15 '19 03:08 jufemaiz

Thanks for figuring this out @jufemaiz, we'll add some validation.

lox avatar Aug 15 '19 23:08 lox

Created a PR #345 to validate the option correctly :)

toote avatar Oct 11 '22 22:10 toote

Thanks @toote – LGTM 🎉 ➕ LGTM 🚀 !

jufemaiz avatar Oct 11 '22 23:10 jufemaiz