dockerimg: more exacting prompt for building a dockerfile
This morning's claude moving target has forgotten how a Dockerfile
works, and it tries injecting direct shell into the file. Tell it
everything should start with RUN.
For #83
For #85
diff --git a/dockerimg/testdata/testcreatedockerfile_empty_repo.dockerfile b/dockerimg/testdata/testcreatedockerfile_empty_repo.dockerfile
index 52d6fc3..d3bec5b 100644
--- a/dockerimg/testdata/testcreatedockerfile_empty_repo.dockerfile
+++ b/dockerimg/testdata/testcreatedockerfile_empty_repo.dockerfile
@@ -17,14 +17,22 @@
# Switch to lenient shell so we are more likely to get past failing extra_cmds.
SHELL ["/bin/bash", "-uo", "pipefail", "-c"]
-# Install any Go tools specific to development
-RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest || true
+RUN go mod tidy || true
-# Install any Python dependencies if needed (allow failures)
+# Install any Python dependencies if a requirements.txt exists, but continue on failure
RUN if [ -f requirements.txt ]; then pip3 install -r requirements.txt || true; fi
-# Pre-compile the project if possible
-RUN if [ -f go.mod ]; then go build -v ./... || true; fi
+# Install any npm dependencies if package.json exists
+RUN if [ -f package.json ]; then npm install || true; fi
+
+# Install additional tools that might be useful for Go development
+RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest || true
+
+# Install any additional needed packages
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ make \
+ protobuf-compiler \
+ || true
# Switch back to strict shell after extra_cmds.
SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]