Skip to content
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
6 changes: 3 additions & 3 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,9 @@ target "_pkg-docker-engine" {
target "_pkg-model" {
args = {
PKG_NAME = PKG_NAME != null && PKG_NAME != "" ? PKG_NAME : "docker-model-plugin"
PKG_REPO = PKG_REPO != null && PKG_REPO != "" ? PKG_REPO : "https://github.com/docker/model-cli.git"
PKG_REPO = PKG_REPO != null && PKG_REPO != "" ? PKG_REPO : "https://github.com/docker/model-runner.git"
PKG_REF = PKG_REF != null && PKG_REF != "" ? PKG_REF : "main"
GO_VERSION = GO_VERSION != null && GO_VERSION != "" ? GO_VERSION : "1.24.7" # https://github.com/docker/model-cli/blob/301126afc8ef4b8330de56db5d2889ddbc978022/Dockerfile#L3
GO_VERSION = GO_VERSION != null && GO_VERSION != "" ? GO_VERSION : "1.24.7" # https://github.com/docker/model-runner/blob/039f7a31c0365f9161c9b9b6bb3888161d16e388/cmd/cli/Dockerfile#L3
GO_IMAGE_VARIANT = GO_IMAGE_VARIANT != null && GO_IMAGE_VARIANT != "" ? GO_IMAGE_VARIANT : "bookworm"
PKG_DEB_EPOCH = PKG_DEB_EPOCH != null && PKG_DEB_EPOCH != "" ? PKG_DEB_EPOCH : ""
}
Expand All @@ -591,7 +591,7 @@ function "pkgPlatforms" {
docker-cli = ["darwin/amd64", "darwin/arm64", "linux/386", "linux/amd64", "linux/arm/v6", "linux/arm/v7", "linux/arm64", "linux/ppc64le", "linux/riscv64", "linux/s390x", "windows/amd64", "windows/arm64"]
# https://github.com/moby/moby/blob/83264918d3e1c61341511e360a7277150b914b3f/docker-bake.hcl#L82-L91
docker-engine = ["linux/amd64", "linux/arm/v6", "linux/arm/v7", "linux/arm64", "linux/ppc64le", "linux/s390x", "windows/amd64", "windows/arm64"]
# https://github.com/docker/model-cli/blob/301126afc8ef4b8330de56db5d2889ddbc978022/Makefile#L36-L40
# https://github.com/docker/model-runner/blob/039f7a31c0365f9161c9b9b6bb3888161d16e388/cmd/cli/Makefile#L39-L43
model = ["darwin/amd64", "darwin/arm64", "linux/amd64", "linux/arm64", "linux/arm/v7", "windows/amd64", "windows/arm64"]
}, pkg, [])
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/model/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ARG DISTRO_ID="12"
ARG DISTRO_IMAGE="debian:bookworm"

ARG PKG_NAME="docker-model-plugin"
ARG PKG_REPO="https://github.com/docker/model-cli.git"
ARG PKG_REPO="https://github.com/docker/model-runner.git"
ARG PKG_REF="main"

ARG GO_IMAGE="golang"
Expand Down
4 changes: 2 additions & 2 deletions pkg/model/deb/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Section: admin
Priority: optional
Maintainer: Docker <[email protected]>
Homepage: https://www.docker.com
Vcs-Browser: https://github.com/docker/model-cli
Vcs-Git: git://github.com/docker/model-cli.git
Vcs-Browser: https://github.com/docker/model-runner
Vcs-Git: git://github.com/docker/model-runner.git
Standards-Version: 3.9.6
Build-Depends: bash,
debhelper-compat (= 12),
Expand Down
4 changes: 2 additions & 2 deletions pkg/model/deb/rules
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ override_dh_builddeb:

override_dh_auto_build:
mkdir -p /usr/libexec/docker/cli-plugins && \
GO111MODULE=on make -C $(CURDIR)/model VERSION=$(VERSION) ce-release \
&& mv $(CURDIR)/model/dist/docker-model /usr/libexec/docker/cli-plugins/docker-model
GO111MODULE=on make -C $(CURDIR)/model/cmd/cli VERSION=$(VERSION) ce-release \
&& mv $(CURDIR)/model/cmd/cli/dist/docker-model /usr/libexec/docker/cli-plugins/docker-model

override_dh_auto_test:
ver="$$(/usr/libexec/docker/cli-plugins/docker-model docker-cli-plugin-metadata | awk '{ gsub(/[",:]/,"")}; $$1 == "Version" { print $$2 }')"; \
Expand Down
4 changes: 2 additions & 2 deletions pkg/model/rpm/docker-model-plugin.spec
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ This plugin provides the 'docker model' subcommand.
%setup -q -c -n src -a 0

%build
GO111MODULE=on make -C ${RPM_BUILD_DIR}/src/model VERSION=%{_origversion} ce-release
GO111MODULE=on make -C ${RPM_BUILD_DIR}/src/model/cmd/cli VERSION=%{_origversion} ce-release

%check
ver="$(${RPM_BUILD_ROOT}%{_libexecdir}/docker/cli-plugins/docker-model docker-cli-plugin-metadata | awk '{ gsub(/[",:]/,"")}; $1 == "Version" { print $2 }')"; \
test "$ver" = "%{_origversion}" && echo "PASS: docker-model version OK" || (echo "FAIL: docker-model version ($ver) did not match" && exit 1)

%install
install -D -p -m 0755 ${RPM_BUILD_DIR}/src/model/dist/docker-model ${RPM_BUILD_ROOT}%{_libexecdir}/docker/cli-plugins/docker-model
install -D -p -m 0755 ${RPM_BUILD_DIR}/src/model/cmd/cli/dist/docker-model ${RPM_BUILD_ROOT}%{_libexecdir}/docker/cli-plugins/docker-model

for f in LICENSE; do
install -D -p -m 0644 "${RPM_BUILD_DIR}/src/model/$f" "docker-model-plugin-docs/$f"
Expand Down
6 changes: 3 additions & 3 deletions pkg/model/scripts/pkg-static-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ binext=$([ "$(xx-info os)" = "windows" ] && echo ".exe" || true)

(
set -x
pushd ${SRCDIR}
# https://github.com/docker/model-cli/blob/main/Makefile#L52C2-L52C145
go build -trimpath -ldflags="-w -X github.com/docker/model-cli/desktop.Version=${GENVER_VERSION}" -o "${BUILDDIR}/${PKG_NAME}/docker-model" .
pushd ${SRCDIR}/cmd/cli
# https://github.com/docker/model-runner/blob/039f7a31c0365f9161c9b9b6bb3888161d16e388/cmd/cli/Makefile#L39-L43
go build -trimpath -ldflags="-w -X github.com/docker/model-runner/cmd/cli/desktop.Version=${GENVER_VERSION}" -o "${BUILDDIR}/${PKG_NAME}/docker-model" .
popd
if [ "$(xx-info os)" = "windows" ]; then
mv "${BUILDDIR}/${PKG_NAME}/docker-model" "${BUILDDIR}/${PKG_NAME}/docker-model.exe"
Expand Down