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 e88c968 commit 9087f6b
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 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,32 @@ 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}"
if [ -d "${dockerCLIBuildDir}" ]; then
cp "${dockerCLIBuildDir}"/* "${dockerBuildDir}/"
fi
if [ -d "${dockerEngineBuildDir}" ]; then
cp "${dockerEngineBuildDir}"/* "${dockerBuildDir}/"
fi
# 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 9087f6b

Please sign in to comment.