Skip to content

Commit d37f8a3

Browse files
committed
Fixed docker build to have uv in the default path
1 parent 144c4e2 commit d37f8a3

File tree

4 files changed

+40
-8
lines changed

4 files changed

+40
-8
lines changed

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ RUN apk update \
1010
&& npm install @coana-tech/cli -g
1111

1212
# Install uv
13-
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
14-
ENV PATH="/root/.cargo/bin:${PATH}"
13+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
1514

1615
# Install CLI with retries for TestPyPI propagation (10 attempts, 30s each = 5 minutes total)
1716
RUN for i in $(seq 1 10); do \
@@ -24,4 +23,6 @@ RUN for i in $(seq 1 10); do \
2423
done && \
2524
if [ ! -z "$SDK_VERSION" ]; then \
2625
pip install --index-url ${PIP_INDEX_URL} --extra-index-url ${PIP_EXTRA_INDEX_URL} socketdev==${SDK_VERSION}; \
27-
fi
26+
fi
27+
28+
# ENTRYPOINT ["socketcli"]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66

77
[project]
88
name = "socketsecurity"
9-
version = "2.2.23"
9+
version = "2.2.24"
1010
requires-python = ">= 3.10"
1111
license = {"file" = "LICENSE"}
1212
dependencies = [

scripts/build_container.sh

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ verify_package() {
2424

2525
echo $VERSION
2626
if [ -z $ENABLE_PYPI_BUILD ] || [ -z $STABLE_VERSION ]; then
27-
echo "$0 pypi-build=enable stable=true"
28-
echo "\tpypi-build: Build and publish a new version of the package to pypi. Options are prod or test"
29-
echo "\tstable: Only build and publish a new version for the stable docker tag if it has been tested and going on the changelog"
27+
echo "$0 pypi-build=<option> stable=<true|false>"
28+
echo "\tpypi-build: Options are prod, test, or local"
29+
echo "\t - prod: Build and publish to production PyPI, then build Docker images"
30+
echo "\t - test: Build and publish to test PyPI, then build Docker images"
31+
echo "\t - local: Build Docker images only using existing PyPI package (specify prod or test via stable parameter)"
32+
echo "\tstable: true/false - Also tag as stable; for local builds, use 'prod' or 'test' to specify PyPI source"
3033
exit
3134
fi
3235

@@ -97,3 +100,31 @@ if [ $STABLE_VERSION = "stable=true" ]; then
97100
&& docker push socketdev/cli:stable
98101
fi
99102

103+
if [ $ENABLE_PYPI_BUILD = "pypi-build=local" ]; then
104+
echo "Building local version without publishing to PyPI"
105+
106+
# Determine PyPI source based on stable parameter
107+
if [ $STABLE_VERSION = "stable=prod" ]; then
108+
echo "Using production PyPI"
109+
PIP_INDEX_URL="https://pypi.org/simple"
110+
PIP_EXTRA_INDEX_URL="https://pypi.org/simple"
111+
TAG_SUFFIX="local"
112+
elif [ $STABLE_VERSION = "stable=test" ]; then
113+
echo "Using test PyPI"
114+
PIP_INDEX_URL="https://test.pypi.org/simple"
115+
PIP_EXTRA_INDEX_URL="https://pypi.org/simple"
116+
TAG_SUFFIX="local-test"
117+
else
118+
echo "For local builds, use stable=prod or stable=test to specify PyPI source"
119+
exit 1
120+
fi
121+
122+
docker build --no-cache \
123+
--build-arg CLI_VERSION=$VERSION \
124+
--build-arg PIP_INDEX_URL=$PIP_INDEX_URL \
125+
--build-arg PIP_EXTRA_INDEX_URL=$PIP_EXTRA_INDEX_URL \
126+
-t socketdev/cli:$VERSION-$TAG_SUFFIX \
127+
-t socketdev/cli:$TAG_SUFFIX .
128+
echo "Local build complete. Tagged as socketdev/cli:$VERSION-$TAG_SUFFIX and socketdev/cli:$TAG_SUFFIX"
129+
fi
130+

socketsecurity/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__author__ = 'socket.dev'
2-
__version__ = '2.2.23'
2+
__version__ = '2.2.24'
33
USER_AGENT = f'SocketPythonCLI/{__version__}'

0 commit comments

Comments
 (0)