I m trying to write a shell script that builds/runs containers and then copies files from docker container to host.
docker build . -t container:latest
docker run -t -d container /bin/bash
docker cp container_id:/xyz/xyz.txt /tmp
How can I capture the container id from the build and then use it within the shell script? Thanks for your help.