mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
fix: some toolkit update
This commit is contained in:
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
services:
|
services:
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:16-alpine
|
image: postgres:18.1-alpine
|
||||||
container_name: memoh-postgres
|
container_name: memoh-postgres
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: memoh
|
POSTGRES_DB: memoh
|
||||||
@@ -75,7 +75,7 @@ services:
|
|||||||
dockerfile: docker/Dockerfile.agent
|
dockerfile: docker/Dockerfile.agent
|
||||||
container_name: memoh-agent
|
container_name: memoh-agent
|
||||||
volumes:
|
volumes:
|
||||||
- ./config.toml:/app/config.toml:ro
|
- ./config.toml:/config.toml:ro
|
||||||
ports:
|
ports:
|
||||||
- "8081:8081"
|
- "8081:8081"
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|||||||
@@ -7,25 +7,97 @@ if [ "$(uname -s)" = "Darwin" ]; then
|
|||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v containerd >/dev/null 2>&1 && command -v nerdctl >/dev/null 2>&1; then
|
if command -v containerd >/dev/null 2>&1 && command -v nerdctl >/dev/null 2>&1 && command -v buildctl >/dev/null 2>&1 && command -v buildkitd >/dev/null 2>&1; then
|
||||||
containerd --version
|
containerd --version
|
||||||
nerdctl --version
|
nerdctl --version
|
||||||
|
buildctl --version
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v apt-get >/dev/null 2>&1; then
|
if ! command -v containerd >/dev/null 2>&1; then
|
||||||
sudo apt-get update
|
if command -v apt-get >/dev/null 2>&1; then
|
||||||
sudo apt-get install -y containerd nerdctl
|
sudo apt-get update
|
||||||
elif command -v dnf >/dev/null 2>&1; then
|
sudo apt-get install -y containerd
|
||||||
sudo dnf install -y containerd nerdctl
|
elif command -v dnf >/dev/null 2>&1; then
|
||||||
elif command -v yum >/dev/null 2>&1; then
|
sudo dnf install -y containerd
|
||||||
sudo yum install -y containerd nerdctl
|
elif command -v yum >/dev/null 2>&1; then
|
||||||
elif command -v apk >/dev/null 2>&1; then
|
sudo yum install -y containerd
|
||||||
sudo apk add --no-cache containerd nerdctl
|
elif command -v apk >/dev/null 2>&1; then
|
||||||
else
|
sudo apk add --no-cache containerd
|
||||||
echo "No supported package manager found. Install containerd manually."
|
else
|
||||||
exit 1
|
echo "No supported package manager found. Install containerd manually."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! command -v nerdctl >/dev/null 2>&1 || ! command -v buildctl >/dev/null 2>&1 || ! command -v buildkitd >/dev/null 2>&1; then
|
||||||
|
OS="$(uname -s | tr '[:upper:]' '[:lower:]')"
|
||||||
|
ARCH="$(uname -m)"
|
||||||
|
NERDCTL_VERSION="${NERDCTL_VERSION:-}"
|
||||||
|
|
||||||
|
if [ "$OS" != "linux" ]; then
|
||||||
|
echo "Automatic nerdctl installation from release is only supported on Linux."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$ARCH" in
|
||||||
|
x86_64|amd64)
|
||||||
|
ARCH="amd64"
|
||||||
|
;;
|
||||||
|
aarch64|arm64)
|
||||||
|
ARCH="arm64"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unsupported architecture for nerdctl release: $ARCH"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -z "$NERDCTL_VERSION" ]; then
|
||||||
|
RELEASES_API_URL="https://api.github.com/repos/containerd/nerdctl/releases/latest"
|
||||||
|
if command -v curl >/dev/null 2>&1; then
|
||||||
|
NERDCTL_VERSION="$(curl -fsSL "$RELEASES_API_URL" | sed -n 's/.*"tag_name":[[:space:]]*"v\{0,1\}\([^"]*\)".*/\1/p' | head -n1)"
|
||||||
|
elif command -v wget >/dev/null 2>&1; then
|
||||||
|
NERDCTL_VERSION="$(wget -qO- "$RELEASES_API_URL" | sed -n 's/.*"tag_name":[[:space:]]*"v\{0,1\}\([^"]*\)".*/\1/p' | head -n1)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$NERDCTL_VERSION" ]; then
|
||||||
|
echo "Failed to detect latest nerdctl version. Set NERDCTL_VERSION manually."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
NERDCTL_TARBALL="nerdctl-full-${NERDCTL_VERSION}-linux-${ARCH}.tar.gz"
|
||||||
|
NERDCTL_URL="https://github.com/containerd/nerdctl/releases/download/v${NERDCTL_VERSION}/${NERDCTL_TARBALL}"
|
||||||
|
TMP_DIR="$(mktemp -d)"
|
||||||
|
TMP_TARBALL="${TMP_DIR}/${NERDCTL_TARBALL}"
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
rm -rf "$TMP_DIR"
|
||||||
|
}
|
||||||
|
trap cleanup EXIT INT TERM
|
||||||
|
|
||||||
|
if command -v curl >/dev/null 2>&1; then
|
||||||
|
curl -fsSL "$NERDCTL_URL" -o "$TMP_TARBALL"
|
||||||
|
elif command -v wget >/dev/null 2>&1; then
|
||||||
|
wget -qO "$TMP_TARBALL" "$NERDCTL_URL"
|
||||||
|
else
|
||||||
|
echo "curl or wget is required to download nerdctl."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
tar -xzf "$TMP_TARBALL" -C "$TMP_DIR"
|
||||||
|
sudo install -m 0755 "$TMP_DIR/bin/nerdctl" /usr/local/bin/nerdctl
|
||||||
|
sudo install -m 0755 "$TMP_DIR/bin/buildctl" /usr/local/bin/buildctl
|
||||||
|
sudo install -m 0755 "$TMP_DIR/bin/buildkitd" /usr/local/bin/buildkitd
|
||||||
|
|
||||||
|
if command -v systemctl >/dev/null 2>&1 && [ -f "$TMP_DIR/lib/systemd/system/buildkit.service" ]; then
|
||||||
|
sudo install -m 0644 "$TMP_DIR/lib/systemd/system/buildkit.service" /etc/systemd/system/buildkit.service
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl enable --now buildkit.service || true
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
containerd --version
|
containerd --version
|
||||||
nerdctl --version
|
nerdctl --version
|
||||||
|
buildctl --version
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ set -e
|
|||||||
IMAGE="memoh-mcp:dev"
|
IMAGE="memoh-mcp:dev"
|
||||||
|
|
||||||
if [ "$(uname -s)" = "Darwin" ]; then
|
if [ "$(uname -s)" = "Darwin" ]; then
|
||||||
limactl shell default -- nerdctl build -f cmd/mcp/Dockerfile -t "$IMAGE" .
|
limactl shell default -- nerdctl build -f docker/Dockerfile.mcp -t "$IMAGE" .
|
||||||
# Import into rootful containerd so the Go agent can find the image
|
# Import into rootful containerd so the Go agent can find the image
|
||||||
limactl shell default -- sh -c "nerdctl save $IMAGE | sudo nerdctl load"
|
limactl shell default -- sh -c "nerdctl save $IMAGE | sudo nerdctl load"
|
||||||
exit $?
|
exit $?
|
||||||
@@ -15,4 +15,4 @@ if ! command -v nerdctl >/dev/null 2>&1; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
nerdctl build -f cmd/mcp/Dockerfile -t "$IMAGE" .
|
nerdctl build -f docker/Dockerfile.mcp -t "$IMAGE" .
|
||||||
|
|||||||
Reference in New Issue
Block a user