使用Docker镜像构build和部署作为构buildmatrix的一部分

是否有可能使用Docker镜像作为构buildmatrix的一部分来testing和部署?

我有一个标准的,正在运行的构buildmatrix和发布的部署步骤,但我需要换出一个特定容器的Linux版本(在quay.io上可用)。

matrix: include: - os: osx rust: stable env: TARGET=x86_64-apple-darwin - os: linux rust: stable env: TARGET=x86_64-unknown-linux-gnu # and some more before_deploy: - bash ci/before_deploy.sh before_install: - export PATH="$PATH:$HOME/.cargo/bin" install: - bash ci/install.sh script: - bash ci/script.sh deploy: provider: releases api_key: - secure: xxx file_glob: true file: ${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}.* # don't delete the artifacts from previous phases skip_cleanup: true # deploy when a new tag is pushed on: tags: true 

我想要做的是replaceos: linux build的Docker镜像,并在其中运行脚本。 这甚至可能吗? 我见过的所有示例都预先在docker命令的脚本步骤中提供,并将其作为service ,对于非Docker构build,这将会失败。