Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguous location for relative directory name for docker build command #22

Closed
qmacro opened this issue Jan 28, 2020 · 2 comments
Closed

Comments

@qmacro
Copy link

qmacro commented Jan 28, 2020

In Ch.2, section "Building container images in Minikube with Ansible", the command to build the image if it's not already built is:

docker build -t {{ image_name }} ../hello-go

This is fine, but I had to double check that I was in the right place, but couldn't find any clear indication of where in the directory tree I should be. This ../hello-go was assuming I was in a directory parallel to hello-go/, and I wasn't. Perhaps it's worth being more explicit?

@geerlingguy
Copy link
Owner

You make a good point—I think I wrote that section from the perspective of this repository's code layout, but never explicitly said to create the automation playbook in a separate directory adjacent to the hello-go app directory.

I've updated the text and added this to the text around the playbook's start:

Crate a new directory hello-go-automation (next to the hello-go directory) with the same inventory file as used in the previous example, and add a main.yml playbook. Start the playbook...

And I added this after that particular docker build command task:

Because this playbook is in a directory adjacent to the hello-go example (which contains the image build Dockerfile), the context passed to the docker build command is ../hello-go. This directs Docker to look for a Dockerfile inside the hello-go directory adjacent to this playbook's hello-go-automation directory.

@geerlingguy
Copy link
Owner

This will be in the next published version of the book.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants