Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
38 changes: 18 additions & 20 deletions build-base-swarm-jenkins-agent.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,25 @@ if %ERRORLEVEL% neq 0 goto end
if %NO_CACHE%=="true" (SET last_arg="--no-cache .") else (SET last_arg=".")

docker build ^
--pull ^
--build-arg DOCKER_REGISTRY_URL=library ^
--pull ^
--build-arg DOCKER_REGISTRY_URL=library ^
--build-arg BASE_IMAGE=ubuntu ^
--build-arg BASE_TAG=20.04 ^
--build-arg ONESCRIPT_PACKAGES="yard" ^
-t %DOCKER_REGISTRY_URL%/oscript-downloader:latest ^
-f oscript/Dockerfile ^
-f oscript/Dockerfile ^
%last_arg%

docker build ^
--pull ^
Copy link
Member

Choose a reason for hiding this comment

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

например, вот здесь мы останемся на протухшем FROM ubuntu:18.04 для основного слоя

Copy link
Author

@ovcharenko-di ovcharenko-di Jan 29, 2026

Choose a reason for hiding this comment

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

ок, но я не могу придумать простого способа обойти это, сохранив возможность собирать образы без Registry

вижу несколько вариантов:

  1. Описать в документации эту особенность (meh)
  2. Отказаться от сборки образов без Registry (meh^2)
  3. Добавить в скрипты функцию, которая будет перед сборкой парсить докерфайлы и делать pull образов принудительно

Copy link
Member

Choose a reason for hiding this comment

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

Screenshot_2026-01-29-09-02-57-347_com openai chatgpt

Интересно, правда так можно?

Copy link
Author

Choose a reason for hiding this comment

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

изучу, спасибо

--build-arg ONEC_USERNAME=%ONEC_USERNAME% ^
--build-arg ONEC_PASSWORD=%ONEC_PASSWORD% ^
--build-arg ONEC_VERSION=%ONEC_VERSION% ^
--build-arg DOCKER_REGISTRY_URL=%DOCKER_REGISTRY_URL% ^
--build-arg ONEC_USERNAME=%ONEC_USERNAME% ^
--build-arg ONEC_PASSWORD=%ONEC_PASSWORD% ^
--build-arg ONEC_VERSION=%ONEC_VERSION% ^
--build-arg DOCKER_REGISTRY_URL=%DOCKER_REGISTRY_URL% ^
--build-arg BASE_IMAGE=oscript-downloader ^
--build-arg BASE_TAG=latest ^
-t %DOCKER_REGISTRY_URL%/onec-client:%ONEC_VERSION% ^
-f client/Dockerfile ^
%last_arg%
-t %DOCKER_REGISTRY_URL%/onec-client:%ONEC_VERSION% ^
-f client/Dockerfile ^
%last_arg%

if %ERRORLEVEL% neq 0 goto end

Expand All @@ -39,14 +38,13 @@ docker push %DOCKER_REGISTRY_URL%/onec-client:%ONEC_VERSION%
if %ERRORLEVEL% neq 0 goto end

docker build ^
--pull ^
--build-arg ONEC_USERNAME=%ONEC_USERNAME% ^
--build-arg ONEC_PASSWORD=%ONEC_PASSWORD% ^
--build-arg ONEC_VERSION=%ONEC_VERSION% ^
--build-arg DOCKER_REGISTRY_URL=%DOCKER_REGISTRY_URL% ^
-t %DOCKER_REGISTRY_URL%/onec-client-vnc:%ONEC_VERSION% ^
-f client-vnc/Dockerfile ^
%last_arg%
--build-arg ONEC_USERNAME=%ONEC_USERNAME% ^
--build-arg ONEC_PASSWORD=%ONEC_PASSWORD% ^
--build-arg ONEC_VERSION=%ONEC_VERSION% ^
--build-arg DOCKER_REGISTRY_URL=%DOCKER_REGISTRY_URL% ^
-t %DOCKER_REGISTRY_URL%/onec-client-vnc:%ONEC_VERSION% ^
-f client-vnc/Dockerfile ^
%last_arg%

if %ERRORLEVEL% neq 0 goto end

Expand All @@ -55,7 +53,7 @@ docker push %DOCKER_REGISTRY_URL%/onec-client-vnc:%ONEC_VERSION%
if %ERRORLEVEL% neq 0 goto end

docker build ^
--build-arg DOCKER_REGISTRY_URL=%DOCKER_REGISTRY_URL% ^
--build-arg DOCKER_REGISTRY_URL=%DOCKER_REGISTRY_URL% ^
--build-arg BASE_IMAGE=onec-client-vnc ^
--build-arg BASE_TAG=%ONEC_VERSION% ^
-t %DOCKER_REGISTRY_URL%/onec-client-vnc-oscript:%ONEC_VERSION% ^
Expand Down
7 changes: 3 additions & 4 deletions build-base-swarm-jenkins-agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ if [ "${NO_CACHE}" = 'true' ] ; then
fi

docker build \
--pull \
--pull \
$no_cache_arg \
--build-arg DOCKER_REGISTRY_URL=library \
--build-arg DOCKER_REGISTRY_URL=library \
--build-arg BASE_IMAGE=ubuntu \
--build-arg BASE_TAG=20.04 \
--build-arg ONESCRIPT_PACKAGES="yard" \
-t ${DOCKER_REGISTRY_URL:+"$DOCKER_REGISTRY_URL/"}oscript-downloader:latest \
-f oscript/Dockerfile \
-f oscript/Dockerfile \
$last_arg
Comment on lines 22 to 31
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find all references to no_cache_arg in build scripts
rg -n '\bno_cache_arg\b' --glob 'build-*.sh'

Repository: firstBitMarksistskaya/onec-docker

Length of output: 467


🏁 Script executed:

#!/bin/bash
# Read the build-base-swarm-jenkins-agent.sh file to see full context
cat -n build-base-swarm-jenkins-agent.sh | head -50

Repository: firstBitMarksistskaya/onec-docker

Length of output: 1887


🏁 Script executed:

#!/bin/bash
# Check other build scripts that reference no_cache_arg
# Let's look at build-server.sh to see if it defines no_cache_arg
cat -n build-server.sh | head -35

Repository: firstBitMarksistskaya/onec-docker

Length of output: 1277


🏁 Script executed:

#!/bin/bash
# Search for how no_cache_arg is defined in any of the scripts
rg -B 5 'no_cache_arg' build-*.sh | head -80

Repository: firstBitMarksistskaya/onec-docker

Length of output: 2145


🏁 Script executed:

#!/bin/bash
# Let's check if no_cache_arg is defined anywhere in the entire file
grep -n 'no_cache_arg=' build-base-swarm-jenkins-agent.sh

Repository: firstBitMarksistskaya/onec-docker

Length of output: 59


🏁 Script executed:

#!/bin/bash
# Also check all build scripts to see if any of them define no_cache_arg
rg 'no_cache_arg\s*=' build-*.sh

Repository: firstBitMarksistskaya/onec-docker

Length of output: 59


Define no_cache_arg or remove it.

Line 24 references $no_cache_arg but it's never defined in this file or any other build script, so the variable silently expands to empty and the --no-cache flag is ignored. The NO_CACHE environment variable is checked and $last_arg is conditionally set, but $no_cache_arg is used instead in the docker build command, creating a logic error.

🧩 Suggested fix
last_arg='.'
+no_cache_arg=''
if [ "${NO_CACHE}" = 'true' ] ; then
-    last_arg='--no-cache .'
+    no_cache_arg='--no-cache'
fi
🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 24-24: no_cache_arg is referenced but not assigned.

(SC2154)

🤖 Prompt for AI Agents
In `@build-base-swarm-jenkins-agent.sh` around lines 22 - 31, The docker build
command references an undefined variable no_cache_arg causing --no-cache to be
ignored; fix by defining no_cache_arg from the existing NO_CACHE env check (same
logic used to set last_arg) or simply replace $no_cache_arg with $last_arg so
the conditional no-cache behavior is applied; update the script where NO_CACHE
is checked and ensure the variable used in the docker build invocation
(no_cache_arg or last_arg) is the one actually set.


docker build \
Expand All @@ -48,7 +48,6 @@ else
fi

docker build \
--pull \
--build-arg ONEC_USERNAME=$ONEC_USERNAME \
--build-arg ONEC_PASSWORD=$ONEC_PASSWORD \
--build-arg ONEC_VERSION=$ONEC_VERSION \
Expand Down
6 changes: 3 additions & 3 deletions build-oscript-swarm-agent.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ if %ERRORLEVEL% neq 0 goto end
if %NO_CACHE%=="true" (SET last_arg="--no-cache .") else (SET last_arg=".")

docker build ^
--pull ^
--build-arg DOCKER_REGISTRY_URL=library ^
--pull ^
--build-arg DOCKER_REGISTRY_URL=library ^
--build-arg BASE_IMAGE=eclipse-temurin ^
--build-arg BASE_TAG=17 ^
-t %DOCKER_REGISTRY_URL%/oscript-jdk:latest ^
Expand All @@ -36,4 +36,4 @@ docker push %DOCKER_REGISTRY_URL%/base-jenkins-agent:latest
if %ERRORLEVEL% neq 0 goto end

:end
echo End of program.
echo End of program.
6 changes: 3 additions & 3 deletions build-oscript-swarm-agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ if [ "${NO_CACHE}" = 'true' ] ; then
fi

docker build \
--pull \
--pull \
$no_cache_arg \
--build-arg DOCKER_REGISTRY_URL=library \
--build-arg DOCKER_REGISTRY_URL=library \
--build-arg BASE_IMAGE=eclipse-temurin \
--build-arg BASE_TAG=17 \
-t ${DOCKER_REGISTRY_URL:+"$DOCKER_REGISTRY_URL/"}oscript-jdk:latest \
-f oscript/Dockerfile \
-f oscript/Dockerfile \
$last_arg
Comment on lines 22 to 30
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for no_cache_arg definition in build scripts
rg -n --glob 'build-*.sh' '\bno_cache_arg\b' -B 2 -A 2

Repository: firstBitMarksistskaya/onec-docker

Length of output: 2312


🏁 Script executed:

#!/bin/bash
# Get the full build-oscript-swarm-agent.sh file to understand context
git ls-files | grep -E 'build-oscript-swarm-agent\.sh'

Repository: firstBitMarksistskaya/onec-docker

Length of output: 105


🏁 Script executed:

#!/bin/bash
# Read the build-oscript-swarm-agent.sh file to check for no_cache_arg definition
cat -n build-oscript-swarm-agent.sh | head -50

Repository: firstBitMarksistskaya/onec-docker

Length of output: 1668


Define no_cache_arg variable before use.

Lines 24 and 33 reference $no_cache_arg but the variable is never set. It silently expands to empty, defeating the intent of the NO_CACHE check. Currently only last_arg is defined (lines 17–20).

Suggested fix
 last_arg='.'
+no_cache_arg=''
 if [ "${NO_CACHE}" = 'true' ] ; then
-    last_arg='--no-cache .'
+    no_cache_arg='--no-cache'
 fi
🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 24-24: no_cache_arg is referenced but not assigned.

(SC2154)

🤖 Prompt for AI Agents
In `@build-oscript-swarm-agent.sh` around lines 22 - 30, The script uses
$no_cache_arg in the docker build command but never defines it; add a definition
(e.g., set no_cache_arg="--no-cache" when NO_CACHE is truthy, otherwise empty)
before the docker build invocation so the NO_CACHE behavior actually takes
effect—place the assignment near where last_arg is defined and reference the
same shell variable name no_cache_arg.


docker build \
Expand Down