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

[master] deb: cleanup makefile, remove unused GITCOMMIT, and pass VERSION_ID through Dockerfile #817

Merged
merged 3 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 3 additions & 4 deletions deb/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
include ../common.mk

PLUGINS_DIR=$(realpath $(CURDIR)/../plugins)
GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/cli) && git rev-parse --short HEAD)
CLI_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/cli) && git rev-parse --short HEAD)
ENGINE_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/docker) && git rev-parse --short HEAD)
GO_BASE_IMAGE=golang
GO_IMAGE?=$(GO_BASE_IMAGE):$(GO_VERSION)-buster
GEN_DEB_VER=$(shell ./gen-deb-ver $(realpath $(CURDIR)/../src/github.com/docker/cli) "$(VERSION)")
EPOCH?=5
GEN_DEB_VER=$(shell ./gen-deb-ver $(realpath $(CURDIR)/../src/github.com/docker/cli) "$(VERSION)")
CLI_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/cli) && git rev-parse --short HEAD)
ENGINE_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/docker) && git rev-parse --short HEAD)
SCAN_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/scan-cli-plugin) && git rev-parse --short HEAD)
BUILDX_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/buildx) && git rev-parse --short HEAD)

Expand Down
4 changes: 1 addition & 3 deletions deb/build-deb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ debSource="$(awk -F ': ' '$1 == "Source" { print $2; exit }' debian/control)"
debMaintainer="$(awk -F ': ' '$1 == "Maintainer" { print $2; exit }' debian/control)"
debDate="$(date --rfc-2822)"

versionID="$(. /etc/os-release && echo "$VERSION_ID")"

# Include an extra `.0` in the version, in case we ever would have to re-build an
# already published release with a packaging-only change.
pkgRevision=0
Expand Down Expand Up @@ -76,7 +74,7 @@ pkgRevision=0
# docker-ce_22.10.6~beta.0-0~debian.11.0~bullseye_amd64.deb
# docker-ce_22.10.6~beta.0-0~ubuntu.22.04.0~jammy_amd64.deb
cat > "debian/changelog" <<-EOF
$debSource (${EPOCH}${EPOCH_SEP}${DEB_VERSION}-0~${DISTRO}.${versionID}.${pkgRevision}~${SUITE}) $SUITE; urgency=low
$debSource (${EPOCH}${EPOCH_SEP}${DEB_VERSION}-0~${DISTRO}.${VERSION_ID}.${pkgRevision}~${SUITE}) $SUITE; urgency=low
* Version: $VERSION
-- $debMaintainer $debDate
EOF
Expand Down
3 changes: 3 additions & 0 deletions deb/debian-bullseye/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG GO_IMAGE
ARG DISTRO=debian
ARG SUITE=bullseye
ARG VERSION_ID=11
ARG BUILD_IMAGE=${DISTRO}:${SUITE}

FROM ${GO_IMAGE} AS golang
Expand All @@ -23,8 +24,10 @@ RUN apt-get update \
COPY sources/ /sources
ARG DISTRO
ARG SUITE
ARG VERSION_ID
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}
ENV VERSION_ID=${VERSION_ID}

COPY --from=golang /usr/local/go /usr/local/go

Expand Down
3 changes: 3 additions & 0 deletions deb/debian-buster/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG GO_IMAGE
ARG DISTRO=debian
ARG SUITE=buster
ARG VERSION_ID=10
ARG BUILD_IMAGE=${DISTRO}:${SUITE}

FROM ${GO_IMAGE} AS golang
Expand All @@ -23,8 +24,10 @@ RUN apt-get update \
COPY sources/ /sources
ARG DISTRO
ARG SUITE
ARG VERSION_ID
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}
ENV VERSION_ID=${VERSION_ID}

COPY --from=golang /usr/local/go /usr/local/go

Expand Down
3 changes: 3 additions & 0 deletions deb/raspbian-bullseye/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG GO_IMAGE
ARG DISTRO=raspbian
ARG SUITE=bullseye
ARG VERSION_ID=11
ARG BUILD_IMAGE=balenalib/rpi-raspbian:${SUITE}

FROM ${GO_IMAGE} AS golang
Expand All @@ -23,8 +24,10 @@ RUN apt-get update \
COPY sources/ /sources
ARG DISTRO
ARG SUITE
ARG VERSION_ID
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}
ENV VERSION_ID=${VERSION_ID}

COPY --from=golang /usr/local/go /usr/local/go

Expand Down
3 changes: 3 additions & 0 deletions deb/raspbian-buster/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG GO_IMAGE
ARG DISTRO=raspbian
ARG SUITE=buster
ARG VERSION_ID=10
ARG BUILD_IMAGE=balenalib/rpi-raspbian:${SUITE}

FROM ${GO_IMAGE} AS golang
Expand All @@ -23,8 +24,10 @@ RUN apt-get update \
COPY sources/ /sources
ARG DISTRO
ARG SUITE
ARG VERSION_ID
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}
ENV VERSION_ID=${VERSION_ID}

COPY --from=golang /usr/local/go /usr/local/go

Expand Down
3 changes: 3 additions & 0 deletions deb/ubuntu-bionic/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG GO_IMAGE
ARG DISTRO=ubuntu
ARG SUITE=bionic
ARG VERSION_ID=18.04
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if it should be 1804 instead?

Copy link
Member

Choose a reason for hiding this comment

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

Ah nevermind that's the right ID

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh! Missed your comment; it looks like deb / dpkg is happy with the current (CalVer) format;

dpkg --compare-versions "23.0.0~rc.1-0~ubuntu.22.10.0~kinetic" ">>" "23.0.0~rc.1-0~ubuntu.22.04.0~jammy" && echo "OK" || echo "KO"
OK

dpkg --compare-versions "22.10.0~kinetic" ">>" "22.04.0~jammy" && echo "OK" || echo "KO"
OK

dpkg --compare-versions "22.10" ">>" "22.04" && echo "OK" || echo "KO"
OK

ARG BUILD_IMAGE=${DISTRO}:${SUITE}

FROM ${GO_IMAGE} AS golang
Expand All @@ -23,8 +24,10 @@ RUN apt-get update \
COPY sources/ /sources
ARG DISTRO
ARG SUITE
ARG VERSION_ID
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}
ENV VERSION_ID=${VERSION_ID}

COPY --from=golang /usr/local/go /usr/local/go

Expand Down
3 changes: 3 additions & 0 deletions deb/ubuntu-focal/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG GO_IMAGE
ARG DISTRO=ubuntu
ARG SUITE=focal
ARG VERSION_ID=20.04
ARG BUILD_IMAGE=${DISTRO}:${SUITE}

FROM ${GO_IMAGE} AS golang
Expand Down Expand Up @@ -29,8 +30,10 @@ RUN apt-get update \
COPY sources/ /sources
ARG DISTRO
ARG SUITE
ARG VERSION_ID
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}
ENV VERSION_ID=${VERSION_ID}

COPY --from=golang /usr/local/go /usr/local/go

Expand Down
3 changes: 3 additions & 0 deletions deb/ubuntu-jammy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG GO_IMAGE
ARG DISTRO=ubuntu
ARG SUITE=jammy
ARG VERSION_ID=22.04
ARG BUILD_IMAGE=${DISTRO}:${SUITE}

FROM ${GO_IMAGE} AS golang
Expand Down Expand Up @@ -29,8 +30,10 @@ RUN apt-get update \
COPY sources/ /sources
ARG DISTRO
ARG SUITE
ARG VERSION_ID
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}
ENV VERSION_ID=${VERSION_ID}

COPY --from=golang /usr/local/go /usr/local/go

Expand Down
3 changes: 3 additions & 0 deletions deb/ubuntu-kinetic/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG GO_IMAGE
ARG DISTRO=ubuntu
ARG SUITE=kinetic
ARG VERSION_ID=22.10
ARG BUILD_IMAGE=${DISTRO}:${SUITE}

FROM ${GO_IMAGE} AS golang
Expand Down Expand Up @@ -29,8 +30,10 @@ RUN apt-get update \
COPY sources/ /sources
ARG DISTRO
ARG SUITE
ARG VERSION_ID
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}
ENV VERSION_ID=${VERSION_ID}

COPY --from=golang /usr/local/go /usr/local/go

Expand Down