version: 2 jobs: build-and-test: docker: - image: docker:17.05.0-ce-git - image: postgres:9.6-alpine steps: - checkout - setup_remote_docker
using the configuration above, I build my image and then want to run tests from within the image as in:
docker run -it --net=host \ -e DATABASE_URL=postgres://postgres:postgres@localhost:5432/dbname \ -e RAILS_ENV=test \ my-rails-image bundle exec rake db:create db:schema:load
I was able to do this in 1.0 with the machine executor and provided postgresql service. I’m not sure how to do this on 2.0 with docker executor.
Thanks for the help