aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitea/workflows/main.yml24
-rw-r--r--.gitea/workflows/mirror.yml6
-rw-r--r--.scripts.d/20-build.sh17
-rw-r--r--.scripts.d/30-test.sh7
-rw-r--r--.scripts.d/40-publish.sh13
-rw-r--r--Dockerfile4
6 files changed, 48 insertions, 23 deletions
diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml
index 25f2393..65b1907 100644
--- a/.gitea/workflows/main.yml
+++ b/.gitea/workflows/main.yml
@@ -10,10 +10,10 @@ jobs:
find-latest-version:
runs-on: ubuntu-latest
container:
- image: gitea.segundo.io/docker/ci-base:latest
+ image: "${{ env.GITEA_REGISTRY_URL }}/docker/ci-base:latest"
credentials:
- username: "${GITEA_REGISTRY_TOKEN}"
- password: "${GITEA_REGISTRY_USER}"
+ username: "${{ env.GITEA_REGISTRY_USER }}"
+ password: "${{ env.GITEA_REGISTRY_TOKEN }}"
outputs:
lt-version: ${{ steps.find-lt-version.outputs.lt-version }}
steps:
@@ -42,10 +42,10 @@ jobs:
env:
LT_VERSION: ${{ needs.find-latest-version.outputs.lt-version }}
container:
- image: gitea.segundo.io/docker/ci-base:latest
+ image: "${{ env.GITEA_REGISTRY_URL }}/docker/ci-base:latest"
credentials:
- username: "${GITEA_REGISTRY_TOKEN}"
- password: "${GITEA_REGISTRY_USER}"
+ username: "${{ env.GITEA_REGISTRY_USER }}"
+ password: "${{ env.GITEA_REGISTRY_TOKEN }}"
steps:
- uses: actions/checkout@v5
- run: |
@@ -55,10 +55,10 @@ jobs:
runs-on: ubuntu-latest
needs: build
container:
- image: gitea.segundo.io/docker/ci-base:latest
+ image: "${{ env.GITEA_REGISTRY_URL }}/docker/ci-base:latest"
credentials:
- username: "${GITEA_REGISTRY_TOKEN}"
- password: "${GITEA_REGISTRY_USER}"
+ username: "${{ env.GITEA_REGISTRY_USER }}"
+ password: "${{ env.GITEA_REGISTRY_TOKEN }}"
steps:
- uses: actions/checkout@v5
- run: |
@@ -70,10 +70,10 @@ jobs:
env:
LT_VERSION: ${{ needs.find-latest-version.outputs.lt-version }}
container:
- image: gitea.segundo.io/docker/ci-base:latest
+ image: "${{ env.GITEA_REGISTRY_URL }}/docker/ci-base:latest"
credentials:
- username: "${GITEA_REGISTRY_TOKEN}"
- password: "${GITEA_REGISTRY_USER}"
+ username: "${{ env.GITEA_REGISTRY_USER }}"
+ password: "${{ env.GITEA_REGISTRY_TOKEN }}"
steps:
- uses: actions/checkout@v5
- run: |
diff --git a/.gitea/workflows/mirror.yml b/.gitea/workflows/mirror.yml
index 901dc86..6586ca4 100644
--- a/.gitea/workflows/mirror.yml
+++ b/.gitea/workflows/mirror.yml
@@ -11,10 +11,10 @@ jobs:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
container:
- image: gitea.segundo.io/docker/ci-base:latest
+ image: "${{ env.GITEA_REGISTRY_URL }}/docker/ci-base:latest"
credentials:
- username: "${GITEA_REGISTRY_TOKEN}"
- password: "${GITEA_REGISTRY_USER}"
+ username: "${{ env.GITEA_REGISTRY_USER }}"
+ password: "${{ env.GITEA_REGISTRY_TOKEN }}"
steps:
- uses: actions/checkout@v5
diff --git a/.scripts.d/20-build.sh b/.scripts.d/20-build.sh
index a78c16b..1e595d8 100644
--- a/.scripts.d/20-build.sh
+++ b/.scripts.d/20-build.sh
@@ -19,10 +19,21 @@ function cleanup() {
}
trap cleanup EXIT
-echo "${GITEA_REGISTRY_TOKEN}" |
- docker login "${REGISTRY}" -u "${GITEA_REGISTRY_USER}" --password-stdin
+>&2 echo "Logging to ${REGISTRY}"
+mkdir -p ~/.docker
+auth=$(printf '%s:%s' "$GITEA_REGISTRY_USER" "$GITEA_REGISTRY_TOKEN" | base64 -w0)
+cat > ~/.docker/config.json <<EOF
+{"auths":{"${REGISTRY}":{"auth":"${auth}"}}}
+EOF
-docker buildx create --name builder --use --bootstrap
+cat > /tmp/buildkitd.toml <<EOF
+[registry."${REGISTRY}"]
+ http = true
+EOF
+
+docker buildx create --name builder \
+ --use --bootstrap \
+ --config /tmp/buildkitd.toml
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag "${IMAGE_NAME}" \
diff --git a/.scripts.d/30-test.sh b/.scripts.d/30-test.sh
index bf84a36..4014698 100644
--- a/.scripts.d/30-test.sh
+++ b/.scripts.d/30-test.sh
@@ -41,7 +41,10 @@ fi
goss --gossfile goss.yaml render >goss-full.yaml
mv goss-full.yaml goss.yaml
-echo "${GITEA_REGISTRY_TOKEN}" |
- docker login "${REGISTRY}" -u "${GITEA_REGISTRY_USER}" --password-stdin
+mkdir -p ~/.docker
+auth=$(printf '%s:%s' "$GITEA_REGISTRY_USER" "$GITEA_REGISTRY_TOKEN" | base64 -w0)
+cat > ~/.docker/config.json <<EOF
+{"auths":{"${REGISTRY}":{"auth":"${auth}"}}}
+EOF
dgoss run "${IMAGE_NAME}"
diff --git a/.scripts.d/40-publish.sh b/.scripts.d/40-publish.sh
index 68820d0..0980f74 100644
--- a/.scripts.d/40-publish.sh
+++ b/.scripts.d/40-publish.sh
@@ -16,9 +16,20 @@ IMAGE_INTERNAL_RELEASE_NAME_LATEST="${REGISTRY}/${GITHUB_REPOSITORY,,}:latest"
IMAGE_EXTERNAL_RELEASE_NAME_VERSIONED="docker.io/${DOCKERHUB_REGISTRY_USER}/languagetool:${LT_VERSION}"
IMAGE_EXTERNAL_RELEASE_NAME_LATEST="docker.io/${DOCKERHUB_REGISTRY_USER}/languagetool:latest"
-docker login "${REGISTRY}" -u "${GITEA_REGISTRY_USER}" --password-stdin <<<"${GITEA_REGISTRY_TOKEN}"
+mkdir -p ~/.docker
+auth=$(printf '%s:%s' "$GITEA_REGISTRY_USER" "$GITEA_REGISTRY_TOKEN" | base64 -w0)
+cat > ~/.docker/config.json <<EOF
+{"auths":{"${REGISTRY}":{"auth":"${auth}"}}}
+EOF
docker login docker.io -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin <<<"${DOCKERHUB_REGISTRY_TOKEN}"
+mkdir -p ~/.config/containers
+cat > ~/.config/containers/registries.conf <<EOF
+[[registry]]
+location = "hagher.elk-terrapin.ts.net:3202"
+insecure = true
+EOF
+
skopeo copy \
--all \
"docker://${IMAGE_TEST_NAME}" \
diff --git a/Dockerfile b/Dockerfile
index 92fa335..2d5626d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -31,8 +31,8 @@ COPY --chown=languagetool misc/init.sh /
COPY --chown=languagetool misc/ngram.sh /
HEALTHCHECK --timeout=10s --start-period=5s \
- CMD curl --fail --data "language=en-US&text=healthcheck test" http://localhost:8010/v2/check || exit 1
+ CMD ["curl", "-f", "--data", "language=en-US&text=healthcheck test", "http://localhost:8010/v2/check"]
CMD [ "bash", "/init.sh" ]
WORKDIR /home/languagetool/LanguageTool-$VERSION
-USER languagetool
+USER 1000
EXPOSE 8010