Skip to content

Commit

Permalink
Merge pull request docker#1 from dhiltgen/revamp_mark2
Browse files Browse the repository at this point in the history
Add metadata and alternate links
  • Loading branch information
seemethere authored Sep 20, 2018
2 parents 2299607 + e08abf8 commit e0f4dec
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 5 deletions.
6 changes: 5 additions & 1 deletion deb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN=docker run --rm -i \
-v $(CURDIR)/debbuild/$@:/build \
debbuild-$@/$(ARCH)

SOURCE_FILES=engine-image cli.tgz docker.service
SOURCE_FILES=engine-image cli.tgz docker.service distribution_based_engine.json
SOURCES=$(addprefix sources/, $(SOURCE_FILES))

.PHONY: help
Expand Down Expand Up @@ -131,6 +131,10 @@ sources/docker.service: ../systemd/docker.service
mkdir -p $(@D)
cp $< $@

sources/distribution_based_engine.json: sources/engine-image
mkdir -p $(@D)
docker inspect "$(shell cat sources/engine-image)" --format '{{ .Config.Labels.distribution_based_engine }}' > $@

sources/engine-image:
mkdir -p $(@D)
$(MAKE) -C ../image image-linux
Expand Down
1 change: 1 addition & 0 deletions deb/common/docker-ce.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ case "$1" in
if ! getent group docker > /dev/null; then
groupadd --system docker
fi
update-alternatives --install /usr/bin/dockerd dockerd /usr/bin/dockerd-ce 1
fi
;;
abort-*)
Expand Down
5 changes: 5 additions & 0 deletions deb/common/docker-ce.prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
set -e

update-alternatives --remove dockerd /usr/bin/dockerd-ce

6 changes: 5 additions & 1 deletion deb/common/rules
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ override_dh_auto_install:
install -D -m 0755 /go/src/github.com/docker/cli/build/docker debian/docker-ce-cli/usr/bin/docker
# docker-ce install
install -D -m 0644 /sources/docker.service debian/docker-ce/lib/systemd/system/docker.service
install -D -m 0755 /source/dockerd debian/docker-ce/usr/bin/dockerd
install -D -m 0755 /source/dockerd debian/docker-ce/usr/bin/dockerd-ce
install -D -m 0755 /source/docker-proxy debian/docker-ce/usr/bin/docker-proxy
install -D -m 0755 /source/docker-init debian/docker-ce/usr/bin/docker-init
install -D -m 0644 /sources/distribution_based_engine.json debian/docker-ce/var/lib/docker/distribution_based_engine.json

override_dh_shlibdeps:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info

override_dh_shlibdeps:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
Expand Down
16 changes: 16 additions & 0 deletions image/Dockerfile.engine
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,24 @@ RUN . /binaries-commits && \

# Final docker image
FROM scratch
ARG VERSION
ARG GITCOMMIT
ARG BUILDTIME
ARG PLATFORM
COPY --from=dockerd-builder /sbin/dockerd /sbin/
COPY --from=proxy-builder /sbin/docker-proxy /sbin/
COPY --from=init-builder /sbin/docker-init /sbin/
COPY --from=runc-builder /usr/local/sbin/runc /sbin/

LABEL \
org.opencontainers.image.authors="Docker Inc." \
org.opencontainers.image.created="${BUILDTIME}" \
org.opencontainers.image.documentation="https://docs.docker.com/" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.revision="${GITCOMMIT}" \
org.opencontainers.image.url="https://www.docker.com/products/docker-engine" \
org.opencontainers.image.vendor="Docker Inc." \
org.opencontainers.image.version="${VERSION}" \
distribution_based_engine="{\"platform\":\"${PLATFORM}\",\"containerd_min_version\":\"1.2.0-beta.1\",\"runtime\":\"host_install\"}"

ENTRYPOINT ["/sbin/dockerd"]
16 changes: 16 additions & 0 deletions image/Dockerfile.engine-dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,23 @@ RUN . /binaries-commits && \

# Final docker image
FROM scratch
ARG VERSION
ARG GITCOMMIT
ARG BUILDTIME
ARG PLATFORM
COPY --from=dockerd-builder /dockerd /sbin/
COPY --from=proxy-builder /docker-proxy /sbin/
COPY --from=init-builder /docker-init /sbin/

LABEL \
org.opencontainers.image.authors="Docker Inc." \
org.opencontainers.image.created="${BUILDTIME}" \
org.opencontainers.image.documentation="https://docs.docker.com/" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.revision="${GITCOMMIT}" \
org.opencontainers.image.url="https://www.docker.com/products/docker-engine" \
org.opencontainers.image.vendor="Docker Inc." \
org.opencontainers.image.version="${VERSION}" \
distribution_based_engine="{\"platform\":\"${PLATFORM}\",\"containerd_min_version\":\"1.2.0-beta.1\",\"runtime\":\"host_install\"}"

ENTRYPOINT ["/sbin/dockerd"]
6 changes: 5 additions & 1 deletion rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RPMBUILD_FLAGS?=-ba\
$(SPECS)
RUN?=$(RPMBUILD) rpmbuild-$@/$(ARCH) $(RPMBUILD_FLAGS)

SOURCE_FILES=engine-image cli.tgz docker.service
SOURCE_FILES=engine-image cli.tgz docker.service distribution_based_engine.json
SOURCES=$(addprefix rpmbuild/SOURCES/, $(SOURCE_FILES))


Expand Down Expand Up @@ -102,3 +102,7 @@ rpmbuild/SOURCES/engine-image:
$(MAKE) -C ../image image-linux-dm
mkdir -p $(@D)
cp ../image/image-linux-dm $@

rpmbuild/SOURCES/distribution_based_engine.json:
mkdir -p $(@D)
docker inspect "$(shell cat rpmbuild/SOURCES/engine-image)" --format '{{ .Config.Labels.distribution_based_engine }}' > $@
8 changes: 6 additions & 2 deletions rpm/SPECS/docker-ce.spec
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,18 @@ depending on a particular stack or provider.

%install
# Install containerd-proxy as dockerd
install -D -m 0755 /sources/dockerd $RPM_BUILD_ROOT/%{_bindir}/dockerd
install -D -m 0755 /sources/dockerd $RPM_BUILD_ROOT/%{_bindir}/dockerd-ce
install -D -m 0755 /sources/docker-proxy $RPM_BUILD_ROOT/%{_bindir}/docker-proxy
install -D -m 0755 /sources/docker-init $RPM_BUILD_ROOT/%{_bindir}/docker-init
install -D -m 0644 %{_topdir}/SOURCES/docker.service $RPM_BUILD_ROOT/%{_unitdir}/docker.service
install -D -m 0644 %{_topdir}/SOURCES/distribution_based_engine.json $RPM_BUILD_ROOT/var/lib/docker/distribution_based_engine.json

%files
/%{_bindir}/dockerd
/%{_bindir}/dockerd-ce
/%{_bindir}/docker-proxy
/%{_bindir}/docker-init
/%{_unitdir}/docker.service
/var/lib/docker/distribution_based_engine.json

%pre
if [ $1 -gt 0 ] ; then
Expand All @@ -82,9 +84,11 @@ fi
if ! getent group docker > /dev/null; then
groupadd --system docker
fi
update-alternatives --install /usr/bin/dockerd dockerd /usr/bin/dockerd-ce 1

%preun
%systemd_preun docker
update-alternatives --remove dockerd /usr/bin/dockerd-ce

%postun
%systemd_postun_with_restart docker
Expand Down

0 comments on commit e0f4dec

Please sign in to comment.