Creation script configuration Docker sur serveur offline.
This commit is contained in:
BIN
dev/docker_offline_package/docker_binaries/docker-28.5.1.tgz
Normal file
BIN
dev/docker_offline_package/docker_binaries/docker-28.5.1.tgz
Normal file
Binary file not shown.
BIN
dev/docker_offline_package/docker_binaries/docker-compose
Executable file
BIN
dev/docker_offline_package/docker_binaries/docker-compose
Executable file
Binary file not shown.
36
dev/docker_offline_package/install_docker_offline.sh
Executable file
36
dev/docker_offline_package/install_docker_offline.sh
Executable file
@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")"
|
||||
# Install static docker binaries included in this package
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "Exécutez en root: sudo ./install_docker_offline.sh"
|
||||
exit 1
|
||||
fi
|
||||
echo "Installation des binaires Docker depuis le package..."
|
||||
# find docker-*.tgz
|
||||
shopt -s nullglob
|
||||
for t in docker_binaries/docker-*.tgz; do
|
||||
echo "Extraction $t ..."
|
||||
tar xzf "$t" -C /tmp/docker_offline_extract || true
|
||||
# copy binaries (best-effort)
|
||||
DIR=$(ls -d /tmp/docker_offline_extract/* 2>/dev/null | head -n1 || true)
|
||||
if [ -n "$DIR" ]; then
|
||||
cp "$DIR"/* /usr/bin/ 2>/dev/null || true
|
||||
chmod +x /usr/bin/docker* /usr/bin/dockerd* /usr/bin/containerd* 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
# install docker-compose plugin if present
|
||||
if [ -f docker_binaries/docker-compose ]; then
|
||||
mkdir -p /usr/libexec/docker/cli-plugins 2>/dev/null || true
|
||||
cp docker_binaries/docker-compose /usr/libexec/docker/cli-plugins/docker-compose 2>/dev/null || true
|
||||
chmod +x /usr/libexec/docker/cli-plugins/docker-compose 2>/dev/null || true
|
||||
fi
|
||||
# Load saved images
|
||||
if [ -d images ]; then
|
||||
for img in images/*.tar; do
|
||||
[ -f "$img" ] || continue
|
||||
echo "Chargement image $img ..."
|
||||
docker load -i "$img" || true
|
||||
done
|
||||
fi
|
||||
echo "Installation offline terminée. Vérifiez 'docker --version' et 'docker compose version'."
|
||||
Binary file not shown.
BIN
dev/docker_offline_package/offline_bundle/docker_binaries/docker-compose
Executable file
BIN
dev/docker_offline_package/offline_bundle/docker_binaries/docker-compose
Executable file
Binary file not shown.
36
dev/docker_offline_package/offline_bundle/install_docker_offline.sh
Executable file
36
dev/docker_offline_package/offline_bundle/install_docker_offline.sh
Executable file
@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")"
|
||||
# Install static docker binaries included in this package
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "Exécutez en root: sudo ./install_docker_offline.sh"
|
||||
exit 1
|
||||
fi
|
||||
echo "Installation des binaires Docker depuis le package..."
|
||||
# find docker-*.tgz
|
||||
shopt -s nullglob
|
||||
for t in docker_binaries/docker-*.tgz; do
|
||||
echo "Extraction $t ..."
|
||||
tar xzf "$t" -C /tmp/docker_offline_extract || true
|
||||
# copy binaries (best-effort)
|
||||
DIR=$(ls -d /tmp/docker_offline_extract/* 2>/dev/null | head -n1 || true)
|
||||
if [ -n "$DIR" ]; then
|
||||
cp "$DIR"/* /usr/bin/ 2>/dev/null || true
|
||||
chmod +x /usr/bin/docker* /usr/bin/dockerd* /usr/bin/containerd* 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
# install docker-compose plugin if present
|
||||
if [ -f docker_binaries/docker-compose ]; then
|
||||
mkdir -p /usr/libexec/docker/cli-plugins 2>/dev/null || true
|
||||
cp docker_binaries/docker-compose /usr/libexec/docker/cli-plugins/docker-compose 2>/dev/null || true
|
||||
chmod +x /usr/libexec/docker/cli-plugins/docker-compose 2>/dev/null || true
|
||||
fi
|
||||
# Load saved images
|
||||
if [ -d images ]; then
|
||||
for img in images/*.tar; do
|
||||
[ -f "$img" ] || continue
|
||||
echo "Chargement image $img ..."
|
||||
docker load -i "$img" || true
|
||||
done
|
||||
fi
|
||||
echo "Installation offline terminée. Vérifiez 'docker --version' et 'docker compose version'."
|
||||
Reference in New Issue
Block a user