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

[docker] Development Dockerfile for ponzu #115

Merged
merged 14 commits into from
Apr 15, 2017

Conversation

krismeister
Copy link
Contributor

This is a development docker file for #72 .

@nilslice
Copy link
Contributor

@krismeister - what is meant by:

NEEDS LINK

Sorry - I'm a pretty basic Docker user.

@krismeister
Copy link
Contributor Author

In this Dockerfile, we're using the official golang docker image hosted on Dockerhub, a free for open source repository of Docker Images.

Ponzu will want to publish it's own Docker Image onto DockerHub. We'll want to link to the page on Dockerhub for ponzu

The steps for this are:

  1. docker build - to create an image on your local machine
  2. Ideally run automated tests.
  3. docker tag - tags your local image with an ID, like v1.3, v1.3.1 etc
  4. docker login - authenticates your machine into DockerHub
  5. docker push - pushes your machine's tagged ponzu image into DockerHub

(Steps 1-5 above can be automated by a github hook, with tools such as CircleCi, CodeShip, jenkins, teamcity etc..)

Developers who want to use the Ponzu Docker Image. Will base their Dockerfile on Ponzu. Their build will inject their own files into the /go/src/project/ directory. And they themselves will run steps 1-5 publishing using their project name in Dockerhub. Their final docker image will contain: Anything in docker:golang, anything in ponzu, and all of their project files.

When they run their Docker Image on their server, their container has ALL their project files. Which is why we need to use the Docker Volume correctly for any files/folders which need to persist between deployments on their server.

@nilslice
Copy link
Contributor

So once the user who has the official Ponzu Docker image pulled, they would run it, and from inside the container build their own project (which they either git pulled or copied in)

At that point they can then re-build the Ponzu image with their files in it or write a new Dockerfile to manage those steps to deploy?

@nilslice
Copy link
Contributor

@krismeister - this is awesome, thank you for putting it together!

Sorry to trouble you, but would you mind splitting these PRs... the ponzu-cms/ponzu/examples directory is targeted at demonstrating the internal features of Ponzu and the ponzu-cms/examples repo is meant for full project examples.

I think the docker/Dockerfile is great to keep in the main repo, but this example deserves more real estate in a dedicated examples area. See here for more about full project examples: https://github.com/ponzu-cms/examples

@krismeister
Copy link
Contributor Author

No problem.

You'll want to setup this on dockerhub: https://docs.docker.com/docker-hub/builds/#create-an-automated-build

And then replace all the NEEDS LINKS.
Then fix the examples repos's docker/admin/Dockerfile

@nilslice nilslice changed the title [DOCKER] Development Dockerfile for ponzu [Docker] Development Dockerfile for ponzu Apr 15, 2017
@nilslice nilslice changed the title [Docker] Development Dockerfile for ponzu [docker] Development Dockerfile for ponzu Apr 15, 2017
@nilslice nilslice merged commit 6268615 into ponzu-cms:ponzu-dev Apr 15, 2017
@nilslice
Copy link
Contributor

Hey @krismeister - sorry to bother you with this, but I don't know why the $ docker build process would result in this error:

Step 8/8 : RUN go get $PONZU_GITHUB...
 ---> Running in 528e824f1813
# github.com/ponzu-cms/ponzu/system/api
system/api/gzip.go:40: undefined: http.Pusher
The command '/bin/sh -c go get $PONZU_GITHUB...' returned a non-zero code: 2

The undefined: http.Pusher is an artifact of pre-1.8 versions of Go, and we're building against golang:latest, which as far as I can see is aliased to 1.8.1
From golang on dockerhub: 1.8.1, 1.8, 1, latest (1.8/Dockerfile)

Do you know what might be happening?

@nilslice
Copy link
Contributor

@krismeister - upon adding RUN go version, it seems that golang:latest is actually 1.7.1, so I'll rebuild with 1.8.1 explicitly and see.

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

Successfully merging this pull request may close these issues.

2 participants