Skip to content

Commit 544bbf8

Browse files
authored
Merge pull request #547 from vvoland/docker-community
pkg/docker: Show the platform name on the Client line of static CLI builds
2 parents 02202a5 + 70df6f1 commit 544bbf8

6 files changed

Lines changed: 11 additions & 6 deletions

File tree

‎pkg/docker-cli/Dockerfile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ ENV PATH="$PATH:/usr/local/go/bin:$GOPATH/bin"
186186
ENV CGO_ENABLED="0"
187187
ENV GOTOOLCHAIN="local"
188188
ENV GO111MODULE="off"
189+
ARG DOCKER_PLATFORM_NAME
189190

190191
FROM build-base-static AS goversioninfo
191192
ARG GOVERSIONINFO_VERSION

‎pkg/docker-cli/scripts/pkg-static-build.sh‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
: "${NIGHTLY_BUILD=}"
1818

19+
: "${DOCKER_PLATFORM_NAME=}"
20+
1921
: "${PKG_NAME=}"
2022

2123
: "${BUILDDIR=/work/build}"
@@ -63,7 +65,7 @@ clibin="docker${binext}"
6365
(
6466
set -x
6567
pushd ${SRCDIR}
66-
VERSION=${GENVER_VERSION#v} GITCOMMIT=${GENVER_COMMIT_SHORT} GO_LINKMODE=static TARGET=${BUILDDIR}/${PKG_NAME} ./scripts/build/binary
68+
PLATFORM="${DOCKER_PLATFORM_NAME}" VERSION=${GENVER_VERSION#v} GITCOMMIT=${GENVER_COMMIT_SHORT} GO_LINKMODE=static TARGET=${BUILDDIR}/${PKG_NAME} ./scripts/build/binary
6769
popd
6870
xx-verify --static "${BUILDDIR}/${PKG_NAME}/docker"
6971
)

‎pkg/docker-engine/scripts/pkg-static-build.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ mkdir -p ${BUILDDIR}/${PKG_NAME}
6262
(
6363
set -x
6464
pushd ${SRCDIR}
65-
CGO_ENABLED=1 VERSION=${GENVER_VERSION#v} DOCKER_GITCOMMIT=${GENVER_COMMIT_SHORT} PLATFORM="${DOCKER_PLATFORM_NAME}" DEFAULT_PRODUCT_LICENSE="${DOCKER_PRODUCT_LICENSE}" ./hack/make.sh binary
65+
CGO_ENABLED=1 VERSION=${GENVER_VERSION#v} DOCKER_GITCOMMIT=${GENVER_COMMIT_SHORT} PLATFORM="${DOCKER_PLATFORM_NAME}" PRODUCT=docker DEFAULT_PRODUCT_LICENSE="${DOCKER_PRODUCT_LICENSE}" ./hack/make.sh binary
6666
mv "./bundles/binary-daemon/dockerd${binext}" "${BUILDDIR}/${PKG_NAME}/"
6767
if [ "$(xx-info os)" != "windows" ]; then
6868
mv "./bundles/binary-daemon/docker-proxy${binext}" "${BUILDDIR}/${PKG_NAME}/"

‎pkg/docker/Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ ENV GOPROXY="https://proxy.golang.org|direct"
139139
ENV GOPATH="/go"
140140
ENV PATH="$PATH:/usr/local/go/bin:$GOPATH/bin"
141141
ENV GOTOOLCHAIN="local"
142+
ARG DOCKER_PLATFORM_NAME
142143

143144
FROM build-base-static AS gowinres
144145
ARG GOWINRES_VERSION
@@ -156,7 +157,6 @@ ARG PKG_NAME
156157
ARG PKG_REF
157158
ARG CLI_REF
158159
ARG DOCKER_VERSION
159-
ARG DOCKER_PLATFORM_NAME
160160
ARG DOCKER_PRODUCT_LICENSE
161161
ARG NIGHTLY_BUILD
162162
ARG TAGPREFIX

‎pkg/docker/scripts/pkg-static-build.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ fetch_git_ref() {
104104
(
105105
set -x
106106
pushd "${ENGINE_SRCDIR}"
107-
CGO_ENABLED=1 VERSION="${version}" DOCKER_GITCOMMIT="${ENGINE_GENVER_COMMIT_SHORT}" PLATFORM="${DOCKER_PLATFORM_NAME}" DEFAULT_PRODUCT_LICENSE="${DOCKER_PRODUCT_LICENSE}" ./hack/make.sh binary
107+
CGO_ENABLED=1 VERSION="${version}" DOCKER_GITCOMMIT="${ENGINE_GENVER_COMMIT_SHORT}" PLATFORM="${DOCKER_PLATFORM_NAME}" PRODUCT=docker DEFAULT_PRODUCT_LICENSE="${DOCKER_PRODUCT_LICENSE}" ./hack/make.sh binary
108108
mv "./bundles/binary-daemon/dockerd${binext}" "${engine_builddir}/"
109109
if [ "$(xx-info os)" != "windows" ]; then
110110
mv "./bundles/binary-daemon/docker-proxy${binext}" "${engine_builddir}/"
@@ -131,7 +131,7 @@ fi
131131
(
132132
set -x
133133
pushd "${CLI_SRCDIR}"
134-
CGO_ENABLED=0 GO111MODULE=off VERSION="${version}" GITCOMMIT="${CLI_GENVER_COMMIT_SHORT}" GO_LINKMODE=static TARGET="${cli_builddir}" ./scripts/build/binary
134+
CGO_ENABLED=0 GO111MODULE=off PLATFORM="${DOCKER_PLATFORM_NAME}" VERSION="${version}" GITCOMMIT="${CLI_GENVER_COMMIT_SHORT}" GO_LINKMODE=static TARGET="${cli_builddir}" ./scripts/build/binary
135135
popd
136136
xx-verify --static "${cli_builddir}/docker"
137137
)

‎pkg/docker/scripts/pkg-static-darwin-build.sh‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17+
: "${DOCKER_PLATFORM_NAME=}"
18+
1719
: "${BUILDDIR=/work/build}"
1820
: "${CLI_SRCDIR=/work/cli-src}"
1921
: "${OUTDIR=/out}"
@@ -53,7 +55,7 @@ mkdir -p "$cli_builddir"
5355
(
5456
set -x
5557
cd "${CLI_SRCDIR}"
56-
CGO_ENABLED=0 GO111MODULE=off VERSION="${VERSION#v}" GITCOMMIT="${CLI_COMMIT:0:7}" GO_LINKMODE=static TARGET="${cli_builddir}" ./scripts/build/binary
58+
CGO_ENABLED=0 GO111MODULE=off PLATFORM="${DOCKER_PLATFORM_NAME}" VERSION="${VERSION#v}" GITCOMMIT="${CLI_COMMIT:0:7}" GO_LINKMODE=static TARGET="${cli_builddir}" ./scripts/build/binary
5759
)
5860
xx-verify --static "${cli_builddir}/docker"
5961

0 commit comments

Comments
 (0)