Skip to content

Commit

Permalink
static: for backward compat keep docker.tgz
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Jan 25, 2023
1 parent f0118fd commit 4b63916
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions static/build-static
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ fi
buildDir="${CURDIR}/build/${TARGETPLATFORM}"

dockerCLIBuildDir="${buildDir}/docker-cli"
dockerBuildDir="${buildDir}/docker-engine"
dockerEngineBuildDir="${buildDir}/docker-engine"
dockerBuildDir="${buildDir}/docker"
containerdBuildDir="${buildDir}/containerd"
rootlessExtrasBuildDir="${buildDir}/docker-rootless-extras"
buildxBuildDir="${buildDir}/docker-buildx"
Expand Down Expand Up @@ -195,12 +196,12 @@ case ${TARGETOS} in
esac

# docker, containerd, and runc
mkdir -p "${dockerBuildDir}"
mkdir -p "${dockerEngineBuildDir}"
case ${TARGETOS} in
linux)
for f in dockerd docker-init docker-proxy; do
if [ -f "${ENGINE_DIR}/build/${targetPair}/$f" ]; then
cp -L "${ENGINE_DIR}/build/${targetPair}/$f" "${dockerBuildDir}/$f"
cp -L "${ENGINE_DIR}/build/${targetPair}/$f" "${dockerEngineBuildDir}/$f"
fi
done
# TODO containerd binaries should be built as part of containerd-packaging, not as part of docker/docker-ce-packaging
Expand All @@ -214,7 +215,7 @@ case ${TARGETOS} in
windows)
for f in dockerd.exe docker-proxy.exe; do
if [ -f "${ENGINE_DIR}/build/${targetPair}/$f" ]; then
cp -L "${ENGINE_DIR}/build/${targetPair}/$f" "${dockerBuildDir}/$f"
cp -L "${ENGINE_DIR}/build/${targetPair}/$f" "${dockerEngineBuildDir}/$f"
fi
done
;;
Expand Down Expand Up @@ -243,6 +244,28 @@ case ${TARGETOS} in
;;
esac

# docker CLI + docker engine
# TODO: for backward compat keep a copy of the old docker.tgz for now
mkdir -p "${dockerBuildDir}"
cp "${dockerCLIBuildDir}"/* "${dockerBuildDir}/"
cp "${dockerEngineBuildDir}"/* "${dockerBuildDir}/"
# package docker
case ${TARGETOS} in
linux | darwin)
(
set -x
tar -C "${buildDir}" -c -z -f "${buildDir}/docker-${GEN_STATIC_VER}.tgz" docker
)
;;
windows)
(
cd "${buildDir}"
set -x
zip -r "docker-${GEN_STATIC_VER}.zip" docker
)
;;
esac

# rootless extras
case ${TARGETOS} in
linux)
Expand Down

0 comments on commit 4b63916

Please sign in to comment.