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

Change stage target to docker-serve in Makefile #9216

Merged
merged 4 commits into from
Jul 27, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ docker-image:
docker-build:
$(DOCKER_RUN) $(DOCKER_IMAGE) hugo

stage:
docker-serve:
$(DOCKER_RUN) -p 1313:1313 $(DOCKER_IMAGE) hugo server --watch --bind 0.0.0.0
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ $ docker run \
--interactive \
--tty \
--volume $(PWD):/src \
kubernetes-hugo:latest \
hugo
-p 1313:1313 \
kubernetes-hugo \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be pegging this on a version, and probably not just latest, IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use $(HUGO_VERSION) as the version. Does that sound reasonable?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that versioning the image makes much sense in this case, as the built image contains the entire contents of the repo (which is highly variable). In this case, latest just means "using the up-to-date contents of the repo" rather than corresponding to, say, a specific version of Go or Hugo.

In general, I feel like image versions make sense only when images are meant to be publicly shared via a registry. When they're intended only as convenient vessels for local build artifacts and processes, a versioning scheme becomes unnecessary IMHO.

Copy link
Contributor Author

@tfogo tfogo Jun 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucperkins that makes sense to me. I'm happy keeping it as it is if @MistyHacks agrees. 😀

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another possibility, however, would be to create versioned images based on HUGO_VERSION, e.g. kubernetes-hugo:0.43.0, that use the website repo as an external volume rather than including the repo inside the image. I'd be happy to make that change if y'all think that's a better approach.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so, I'd say merge this first to make sure the "make API" is where we want it to be and then I can modify what the commands do.

hugo server \
--watch \
--bind 0.0.0.0
```

As when building without using a Docker container, the results of the build will be published to the `public` directory (the default output directory for [Hugo](https://gohugo.io), the static site generator used to build this site).
Expand Down