diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index e5add43e..42eaff97 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -15,6 +15,15 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Get latest tool versions + id: versions + run: | + UV_VERSION=$(git ls-remote --tags --sort=-v:refname https://github.com/astral-sh/uv.git 'refs/tags/[0-9]*' | head -1 | sed 's/.*refs\/tags\///') + OPENCODE_VERSION=$(git ls-remote --tags --sort=-v:refname https://github.com/opencode-ai/opencode.git 'refs/tags/v*' | head -1 | sed 's/.*refs\/tags\///') + echo "uv=${UV_VERSION}" >> $GITHUB_OUTPUT + echo "opencode=${OPENCODE_VERSION}" >> $GITHUB_OUTPUT + echo "Detected versions: uv=${UV_VERSION}, opencode=${OPENCODE_VERSION}" + - name: Docker meta id: meta uses: docker/metadata-action@v5 @@ -47,6 +56,9 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + build-args: | + UV_VERSION=${{ steps.versions.outputs.uv }} + OPENCODE_VERSION=${{ steps.versions.outputs.opencode }} cache-from: type=gha cache-to: type=gha,mode=max target: runner diff --git a/Dockerfile b/Dockerfile index 947c5453..11bb281e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,11 +33,6 @@ RUN curl -fsSL https://bun.sh/install | bash && \ chmod -R 755 /opt/bun && \ ln -s /opt/bun/bin/bun /usr/local/bin/bun -RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \ - mv /root/.local/bin/uv /usr/local/bin/uv && \ - mv /root/.local/bin/uvx /usr/local/bin/uvx && \ - chmod +x /usr/local/bin/uv /usr/local/bin/uvx - WORKDIR /app FROM base AS deps @@ -62,7 +57,15 @@ RUN pnpm --filter frontend build FROM base AS runner -RUN curl -fsSL https://opencode.ai/install | bash && \ +ARG UV_VERSION=latest +ARG OPENCODE_VERSION=latest + +RUN echo "Installing uv=${UV_VERSION} opencode=${OPENCODE_VERSION}" && \ + curl -LsSf https://astral.sh/uv/install.sh | UV_NO_MODIFY_PATH=1 sh && \ + mv /root/.local/bin/uv /usr/local/bin/uv && \ + mv /root/.local/bin/uvx /usr/local/bin/uvx && \ + chmod +x /usr/local/bin/uv /usr/local/bin/uvx && \ + curl -fsSL https://opencode.ai/install | bash -s -- --no-modify-path && \ mv /root/.opencode /opt/opencode && \ chmod -R 755 /opt/opencode && \ ln -s /opt/opencode/bin/opencode /usr/local/bin/opencode