Closed toolmantim closed 8 years ago
Thanks @toolmantim. Sorry for posting to your slack channel instead of this issue tracker.
@blueimp that's okay! I didn't want the things you figured out to be lost in a sea of chat.
So we switched away from auto builds because it was getting too hard to maintain all the Dockerfiles… we had bug fixes being missed in some images. I agree it's hard to replicate and think about though. What's a good solution do you think?
Also, did you know what in this repo needs changing based on your base image suggestions? Totally fine if not, I'll just leave this here until I get a proper chance to dive in.
From my point of view, auto builds actually help in automating. Especially since you can define linked repositories (usually base images) that will trigger a build.
I recommend using the official images whenever possible, e.g. using FROM docker:1.9
.
The following would be a sample image for a Docker 1.9 based build with the buildkite agent:
FROM docker:1.9
# Install tini and remove its backwards compatibility wrapper:
RUN apk --no-cache add \
--repository http://dl-cdn.alpinelinux.org/alpine/v3.4/community/ \
tini \
&& rm /usr/bin/tini
RUN apk --no-cache add \
# git, bash, openssh-client and curl are required for the buildkite-agent:
git \
bash \
openssh-client \
curl \
# perl is required for git submodules support:
perl \
# py-pip is required to install docker-compose, awscli and awsebcli:
py-pip \
&& pip install --upgrade \
# Upgrade pip:
pip \
# Install docker-compose 1.7.1:
docker-compose==1.7.1 \
# Clean up obsolete files:
&& rm -rf \
# Clean up any temporary files:
/tmp/* \
# Clean up the pip cache:
/root/.cache \
# Remove any compiled python files (compile on demand):
`find / -regex '.*\.py[co]'`
# Install the buildkite agent:
RUN rm /usr/bin/wget && curl \
https://raw.githubusercontent.com/buildkite/agent/master/install.sh | \
DESTINATION=/buildkite bash \
&& ln -s /bin/busybox /usr/bin/wget
# Set the buildkite agent environment variables:
ENV PATH="$PATH":/buildkite/bin \
BUILDKITE_BOOTSTRAP_SCRIPT_PATH=/buildkite/bootstrap.sh \
BUILDKITE_BUILD_PATH=/buildkite/builds \
BUILDKITE_HOOKS_PATH=/buildkite/hooks
# Start tini:
ENTRYPOINT ["tini", "--"]
# Start the buildkite agent:
CMD ["buildkite-agent", "start"]
We use this with the addition of some additional tools.
Images for different Docker versions would simply change the FROM
line.
I must have broken this in https://github.com/buildkite/docker-buildkite-agent/pull/34
From @blueimp …
Hi there, I'd like to use the official alpine based docker images, but noticed that the tags don't match the docker version, e.g.:
returns
I guess the reason is that the alpine image is based on
alpine:edge
which does not include docker 1.9 in it's repositories. The solution could be to install docker 1.9 from the alpine:3.3 repositories, as such:I'd also suggest to switch to
alpine:3.4
, which includestini
and the DNS resolution fixes for which many were usingalpine:edge
already. Alternatively, you could also usedocker:1.9
as base image, which is also based on alpine.Another thing I'd like to see would be Docker images based on automated builds, as this makes it a little more transparent to what the image actually contains.