Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Git
.git
.gitignore
.github

# Python
__pycache__
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
venv/
env/
ENV/

# Testing
.pytest_cache/
.coverage
htmlcov/
tests/
tests_*/
test_external_plugins/
conftest.py

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# Documentation
docs/
*.md
!README.md

# CI/CD
.pre-commit-config.yaml

# Other
*.log
.DS_Store
scripts/
snyk/
performance_history_analysis.py
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# step 1 - build the cli
FROM python:3.10-slim AS builder
WORKDIR /build
RUN apt-get update && apt-get install -y \
gcc \
g++ \
libffi-dev \
libssl-dev \
git \
&& rm -rf /var/lib/apt/lists/*

COPY pyproject.toml ./
COPY README.md ./
COPY LICENSE ./
COPY src ./src

RUN pip install --no-cache-dir hatch && hatch build -t wheel

# step 2 - package the cli to a minimal image
FROM python:3.10-slim
RUN apt-get update && apt-get install -y libssl3 && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /build/dist/*.whl /tmp/
RUN pip install --no-cache-dir /tmp/*.whl && rm -rf /tmp/*.whl
ENV SF_SKIP_WARNING_FOR_READ_PERMISSIONS_ON_CONFIG_FILE=true
ENTRYPOINT ["snow"]
CMD ["--help"]
24 changes: 24 additions & 0 deletions build-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"

echo "Building snowflake-cli Docker image..."
echo "======================================="

docker build --progress=plain -t snowflake-cli "$SCRIPT_DIR"

if [ $? -eq 0 ]; then
echo ""
echo "======================================="
echo "Build successful!"
echo "Image: snowflake-cli:latest"
echo ""
echo "Usage:"
echo " docker run --rm snowflake-cli --version"
echo " docker run --rm snowflake-cli --help"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The usage examples reference snowflake-cli as the image name, but the PR title mentions creating a snow-cli container. For consistency, either:

  1. Update these examples to use snow-cli:

    docker run --rm snow-cli --version
    docker run --rm snow-cli --help
    
  2. Or ensure the Docker build process uses snowflake-cli as the image name throughout the implementation.

Maintaining consistent naming will prevent confusion for users following these examples.

Suggested change
echo "Image: snowflake-cli:latest"
echo ""
echo "Usage:"
echo " docker run --rm snowflake-cli --version"
echo " docker run --rm snowflake-cli --help"
echo "Image: snow-cli:latest"
echo ""
echo "Usage:"
echo " docker run --rm snow-cli --version"
echo " docker run --rm snow-cli --help"

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

else
echo ""
echo "======================================="
echo "Build failed!"
exit 1
fi
Loading