Add insecure-registries config for Docker daemon

This commit is contained in:
masoud
2025-12-06 17:11:58 +00:00
parent 982589d17c
commit 81c8d9f2b4

View File

@@ -8,9 +8,6 @@ on:
env:
REGISTRY: 194.5.195.53:30080
IMAGE_NAME: admin/backoffice-bff
HTTP_PROXY: http://proxyuser:87zH26nbqT2@46.249.98.211:3128
HTTPS_PROXY: http://proxyuser:87zH26nbqT2@46.249.98.211:3128
NO_PROXY: 127.0.0.1,localhost,194.5.195.53,.svc,.cluster.local
jobs:
build:
@@ -19,19 +16,30 @@ jobs:
image: docker:latest
options: --privileged
steps:
- name: Set proxy for apk
run: |
export http_proxy=http://proxyuser:87zH26nbqT2@46.249.98.211:3128
export https_proxy=http://proxyuser:87zH26nbqT2@46.249.98.211:3128
- name: Install git
run: |
export http_proxy=http://proxyuser:87zH26nbqT2@46.249.98.211:3128
export https_proxy=http://proxyuser:87zH26nbqT2@46.249.98.211:3128
apk add --no-cache git
- name: Checkout code
run: |
git config --global http.proxy ""
git config --global https.proxy ""
git clone --depth 1 --branch kub-stage http://194.5.195.53:30080/admin/BackOffice.BFF.git .
git log -1 --format="%H %s"
- name: Start Docker daemon
- name: Start Docker daemon with insecure registry
run: |
mkdir -p /etc/docker
cat > /etc/docker/daemon.json << 'DOCKER_EOF'
{
"insecure-registries": ["194.5.195.53:30080"]
}
DOCKER_EOF
dockerd &
for i in $(seq 1 30); do
docker info >/dev/null 2>&1 && break || sleep 2
@@ -44,8 +52,8 @@ jobs:
docker build -f BackOffice.BFF.WebApi/Dockerfile \
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \
--build-arg HTTP_PROXY=${{ env.HTTP_PROXY }} \
--build-arg HTTPS_PROXY=${{ env.HTTPS_PROXY }} \
--build-arg HTTP_PROXY=http://proxyuser:87zH26nbqT2@46.249.98.211:3128 \
--build-arg HTTPS_PROXY=http://proxyuser:87zH26nbqT2@46.249.98.211:3128 \
.
- name: Push to Registry