Skip to content

Commit 9fd102a

Browse files
authored
Merge pull request #142 from SocketDev/fix-go-env
fix GOROOT when go is installed via apk
2 parents 30574b8 + e10dd4e commit 9fd102a

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 2.2.57
4+
5+
- Fixed Dockerfile to set `GOROOT` to `/usr/lib/go` when using system Go (`GO_VERSION=system`) instead of always using `/usr/local/go`.
6+
37
## 2.2.56
48

59
- Removed process timeout from reachability analysis subprocess. Timeouts are now only passed to the Coana CLI via the `--analysis-timeout` flag.

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ RUN apk update && apk add --no-cache \
2020

2121
# Install Go with version control
2222
RUN if [ "$GO_VERSION" = "system" ]; then \
23-
apk add --no-cache go; \
23+
apk add --no-cache go && \
24+
echo "/usr/lib/go" > /etc/goroot; \
2425
else \
2526
cd /tmp && \
2627
ARCH=$(uname -m) && \
@@ -31,7 +32,8 @@ RUN if [ "$GO_VERSION" = "system" ]; then \
3132
esac && \
3233
wget https://golang.org/dl/go${GO_VERSION}.linux-${GOARCH}.tar.gz && \
3334
tar -C /usr/local -xzf go${GO_VERSION}.linux-${GOARCH}.tar.gz && \
34-
rm go${GO_VERSION}.linux-${GOARCH}.tar.gz; \
35+
rm go${GO_VERSION}.linux-${GOARCH}.tar.gz && \
36+
echo "/usr/local/go" > /etc/goroot; \
3537
fi
3638

3739
# Install Java with version control
@@ -64,8 +66,7 @@ RUN npm install @coana-tech/cli socket -g && \
6466
rustup component add rustfmt clippy
6567

6668
# Set environment paths
67-
ENV PATH="/usr/local/go/bin:/root/.cargo/bin:${PATH}"
68-
ENV GOROOT="/usr/local/go"
69+
ENV PATH="/usr/local/go/bin:/usr/lib/go/bin:/root/.cargo/bin:${PATH}"
6970
ENV GOPATH="/go"
7071

7172
# Install uv

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.56"
9+
version = "2.2.57"
1010
requires-python = ">= 3.10"
1111
license = {"file" = "LICENSE"}
1212
dependencies = [

scripts/docker-entrypoint.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
# docker run socketdev/cli socketcli --params
55
# docker run socketdev/cli --cli-params
66

7+
# Set GOROOT from the value determined at build time
8+
export GOROOT=$(cat /etc/goroot)
9+
710
# Check if we have any arguments
811
if [ $# -eq 0 ]; then
912
# No arguments provided, run socketcli with no args (will show help)

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.56'
2+
__version__ = '2.2.57'
33
USER_AGENT = f'SocketPythonCLI/{__version__}'

0 commit comments

Comments
 (0)