arquillian / arquillian-cube

Control (docker, kubernetes, openshift) containers in your tests with ease!
http://arquillian.org/arquillian-cube/
120 stars 98 forks source link

Multiple image tags pulled if a specific tag is not specified in the container spec #523

Closed jamesnetherton closed 7 years ago

jamesnetherton commented 7 years ago
Issue Overview

I wiped out all of my Docker images and ran a WildFly Arquillian Cube test. Here's what the cube config looked like:

CubeDockerConfiguration: 
  serverUri = unix:///var/run/docker.sock
  tlsVerify = false
  dockerServerIp = localhost
  definitionFormat = CUBE
  clean = false
  removeVolumes = true
  dockerContainers = containers:
  wildfly:
    alwaysPull: false
    await: {stdErr: false, stdOut: true, strategy: org.wildfly.camel.test.docker.WildFlyAwaitStrategy,
      timeout: 15}
    env: [WILDFLY_MANAGEMENT_USER=admin, WILDFLY_MANAGEMENT_PASSWORD=admin]
    exposedPorts: [8080/tcp, 9990/tcp]
    image: wildflyext/wildfly-camel
    manual: false
    portBindings: [8080/tcp, 9990/tcp]
    readonlyRootfs: false
    removeVolumes: true
networks: {}

Note that I did not specify a tag on the image. My test was hung at this message:

Nov 17, 2016 11:30:14 AM org.arquillian.cube.docker.impl.docker.DockerClientExecutor createContainer
WARNING: Docker Image wildflyext/wildfly-camel is not on DockerHost and it is going to be automatically pulled.

When I ran docker images, I noticed that every tag for the image was being pulled.

Expected Behaviour

If no tag is specified on the image name then I'd expect that only latest is pulled. I can't think of a scenario where I'd want every tag to be pulled (think how much bandwidth & disk space that could potentially use up :smile: ).

Current Behaviour

All tags are pulled.

Steps To Reproduce
  1. Ensure that docker image wildflyext/wildfly-camel (or whatever) is not present on the host
  2. Create Arquillian Cube config where the image attribute has no tag specified
  3. Run test and observe multiple image tags being pulled
lordofthejars commented 7 years ago

Hi thanks for the report, in fact this behaviour is implemented in docker-java library and not cube itself. I am going to check if any new version of docker-java fixes this/it is the expected behaviour and then decide where to fix it. Thank you very much for using cube.

lordofthejars commented 7 years ago

In fact notice that according to Docker documentation:

tag – Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled.

So it is the expected behaviour so it is not a bug. What we are going to do in Cube is to set latest in case of not setting a tag.