Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Dockerfile for container-structure-test

Dockerfile for container-structure-test

Use the following docker-compose file. It will build directly from this gist.
To be more stable, copy the Dockerfile and build on your own.

version: "3.3"

services:
  structure-test:
    build: https://gist.github.com/kekru/f650dc96fd85f0fb7dcacea6f8d216ea.git
    image: structure-test
    environment:
     - TEST_IMAGE=image-to-test
     - TEST_CONFIG=/test.yml
    volumes:
     - ./test.yml:/test.yml:ro
     - /var/run/docker.sock:/var/run/docker.sock:ro 

Be sure that you have a test.yml beside your docker-compose.yml, which defines your container-structure-test config.
Replace image-to-test with the image's name, that you want to test.

Start the test with docker-compose run structure-test

FROM alpine:3.9
RUN apk add --no-cache curl
RUN curl -LO https://storage.googleapis.com/container-structure-test/v1.8.0/container-structure-test-linux-amd64 \
&& chmod +x container-structure-test-linux-amd64 \
&& mv container-structure-test-linux-amd64 /usr/local/bin/cst
WORKDIR /data
ENV TEST_CONFIG=test.yml \
TEST_IMAGE=""
CMD cst test --image $TEST_IMAGE --config $TEST_CONFIG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.