Docker Community Forums

Share and learn in the Docker community.

Newbie questions about automated builds and build context

I’m a web developer for my day job - wordpress mainly and I’m starting to try and wrap my head around docker and understand how it could help me going forward. For every project I will have my theme under version control an use Bitbucket for my origin.

I understand that I can link a docker hub repository to a Bitbucket repository to trigger a build, but I don’t really get the practicalities of this.

To keep things simple, lets say I have a website, just an index.html file in a repository which is under version control and I want to create and deploy a Docker image based on ubuntu:latest with this website running.

Where would the Dockerfile reside? At the root directory of the website?

Would the Dockerfile contain commands to pull down the website from Bitbucket as part of the build or would you achieve this another way?

How does the build context setting affect all this - I can’t wrap my head around what that does

Assuming the Docker build is successful, how would I then trigger a deployment to something like AWS EC2 where I’ve got a VM?

Sorry, lots of questions - I’ve read a bunch of the documents but some things just aren’t making sense to me so putting it context to something I might want to achieve would help!

1 Like