-
Notifications
You must be signed in to change notification settings - Fork 14
Simplify docker images down to three variants #44
Conversation
3db4d25
to
00c1841
Compare
@toolmantim it looks like the edge image at https://download.buildkite.com/agent/experimental/3.0-beta.10.1323/buildkite-agent-linux-amd64 is returning a dynamically linked binary, so it's failing the test. This at least verifies that it's worth having a test rather than auto-building via Docker Hub which I was seriously considering :) |
I updated to the latest experimental build and everything works fine. |
Using https://docs.docker.com/compose/install/#install-as-a-container for installing docker-compose. |
Nice work! What was too hard about a local install of
Something we can do is trigger the Docker Hub build from the Buildkite pipeline (they have a URL you can curl to kick it off), rather than on the GitHub change. If we wanted to do that. |
This is looking nice! 👌 |
.buildkite/steps/release.sh
Outdated
done | ||
|
||
# variants of beta 3.0-beta.9 | ||
for tag in 3.0-beta.9 3.0 3 ; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beta 9 or 16?
So what do we have to do to move this forward? |
I've pushed images to https://hub.docker.com/r/lox24/buildkite-agent/ for this PR. |
Going to do some testing on a PR on https://github.com/buildkite/elastic-ci-stack-for-aws |
Btw @toolmantim, the hard bit about docker-compose is that it needs python installed. The current solution is a shim script that calls a docker-compose docker image, but I think that might end up being too complicated. |
This seems almost ready for release! The labels look the same, and I can't spot anything else that's a breaking change, aside from removing DIND. I wonder what the best solution is for people wanting to add DIND support? Perhaps building your own custom image? FROM buildkite/agent
ADD https://raw.githubusercontent.com/docker/docker/v.13.1/hack/dind /usr/local/bin
RUN chmod +x /usr/local/bin/dind
# copy and pasted from buildkite/agent base, with "dind" added
ENTRYPOINT ["dind", "/sbin/tini", "-g", "--", "ssh-env-config.sh", "/usr/local/bin/buildkite-agent"] |
Related to @blueimp’s feedback in #38, perhaps instead of So the above DIND example would become: FROM buildkite/agent
ADD https://raw.githubusercontent.com/docker/docker/v.13.1/hack/dind /usr/local/bin
RUN chmod +x /usr/local/bin/dind
ENTRYPOINT ["dind", "buildkite-agent-entrypoint"] Or does |
61d23b3
to
6531dad
Compare
IMO this is good to go. We might just need some docs updated. |
@toolmantim |
Thanks @blueimp. Okay, so I believe the updated DIND example would be this then: FROM buildkite/agent
RUN curl -sL https://github.com/docker/docker/raw/v1.13.1/hack/dind > /docker-entrypoint.d/dind \
&& chmod +x /docker-entrypoint.d/dind |
README.md
Outdated
|
||
There is a wrapper script in the container that invokes a container for docker-compose. This is done to keep the image small, as docker-compose requires a python environment. | ||
|
||
Using it requires that you mount a volume into the container for `/buildkite`, and pass in the name of that volume as an env called ``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that you can now only use docker-compose if you've created a docker volume and mounted it into /buildkite
? Whereas before, it'd Just Work™?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh this needs to be updated. I ended up going back to installing docker-compose directly. Adds about 90M to the image, but I think it's worth it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! I think so too.
7269fed
to
ff9a3f0
Compare
README.md
Outdated
@@ -4,20 +4,18 @@ Docker images for the [Buildkite Agent](https://github.com/buildkite/agent). A v | |||
|
|||
> If you don't need to run the agent on a purely Docker-based operating system (such as Kubernetes), and instead just want to [run your builds inside Docker containers](https://buildkite.com/docs/guides/docker-containerized-builds), then we recommend using one of the standard installers (such as `apt`). See the [containerized builds guide](https://buildkite.com/docs/guides/docker-containerized-builds) for more information. | |||
|
|||
The Buildkite Agent is available via an Alpine Linux based image, with either the stable, beta or experimental versions of the Buildkite Agent, with or without docker: | |||
The Buildkite Agent is built on Alpine Linux, with either the stable, beta or experimental versions of the Buildkite Agent, with or without docker: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we axe with or without docker
now yeah?
README.md
Outdated
@@ -76,6 +65,10 @@ A less-recommended approach is to use the built-in [docker-ssh-env-config](https | |||
|
|||
Another approach is to use the [environment agent hook](https://buildkite.com/docs/agent/hooks) to pull down the key into the container’s file system before the `git checkout` occurs. Note: the key will exist in Docker’s file system unless it is destroyed. | |||
|
|||
## Customizing the image on boot | |||
|
|||
The default entrypoint will look for any scripts in `/docker-entrypoint.d/` and run them. This allows for bootstrap scripts to be mounted into the agent to install things (via apk or pip) before the agent starts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about:
## Entrypoint customizations
The entrypoint uses `tini` to correctly pass signals to, and kill, sub-processes. Instead of redefining `ENTRYPOINT` we recommend you copy executable scripts into `/docker-entrypoint.d/`. All executable scripts in that directory will be executed in alphanumeric order.
README.md
Outdated
|
||
If in doubt, go with `buildkite/agent`—it's the smallest, most stable, and includes the docker client. | ||
If in doubt, go with `buildkite/agent:latest`—it's the most stable, and includes the docker client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for :latest
here?
@rimusz do you know how this will affect https://github.com/buildkite/helm-charts? This removes DIND support from |
@toolmantim do not worry about the DIND removal, |
Updated docs @toolmantim |
This looks great! The last bit that I can see is that now is that we're versioning these images with the agent version, and we'll need to update the release process too so it's automated from the agent pipeline. At the moment we just trigger the Docker pipeline and it rebuilds all images every time, no matter if it's a stable, beta or experimental release. We can probably feed the agent version and SHA256 to the pipeline via the trigger, and have it automatically update the Readme & Dockerfiles via the GitHub API, which would trigger its own build? So, perhaps 2 pipelines…
The agent pipeline does the GitHub API stuff for the homebrew recipe at the moment. Though it's a bit gross. |
@rimusz thanks for clarifying! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 It's time!
This extends on #38.
It simplifies down to three basic alpine based images,
latest
(stable),beta
andexperimental
. Each contains the relevant agent and some basic stuff likesu-exec
,docker
(client 1.13),jq
andcurl
.Images end up at around 230 MB.