diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 43a9700..ab45e74 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,15 +3,15 @@ variables: IMAGE_TAG_COMPOSE: $CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-compose DOCKER_HUB_REPOSITORY: k911/docker-client DOCKER_TLS_CERTDIR: /certs - DOCKER_RUNNER_VERSION: 20.10.5 - DOCKER_VERSION: 20.10.5 - DOCKER_COMPOSE_VERSION: 1.29.0 + DOCKER_RUNNER_VERSION: 23.0.2 + DOCKER_VERSION: 23.0.2 + DOCKER_COMPOSE_VERSION: 2.17.2 TRIVY_VERSION: 0.16.0 - DOCKER_BUILDX_VERSION: 0.5.1 - DOCKER_AWS_ECR_CREDENTIAL_HELPER_VERSION: 0.5.0 - DOCKER_PASS_CREDENTIAL_HELPER_VERSION: 0.6.3 + DOCKER_BUILDX_VERSION: 0.10.4 + DOCKER_AWS_ECR_CREDENTIAL_HELPER_VERSION: 0.6.0 + DOCKER_PASS_CREDENTIAL_HELPER_VERSION: 0.7.0 PYTHON_VERSION: "3.9" - ALPINE_VERSION: "3.13" + ALPINE_VERSION: "3.16" # do not run duplicate "detached" pipelines # https://docs.gitlab.com/ee/ci/yaml/README.html#workflowrules-templates diff --git a/Dockerfile b/Dockerfile index bbff233..eb1a0ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,21 @@ # https://github.com/moby/moby/releases -ARG DOCKER_VERSION="20.10.5" +ARG DOCKER_VERSION="23.0.2" # https://github.com/docker/compose/releases -ARG DOCKER_COMPOSE_VERSION="1.29.0" +ARG DOCKER_COMPOSE_VERSION="2.17.2" FROM docker:${DOCKER_VERSION} as client -RUN apk add --update jq bash curl git openssh-client pass && \ +RUN apk add --update jq bash curl git openssh-client pass dirmngr gpg-agent && \ apk upgrade && \ rm -rf /var/cache/apk/* # https://github.com/docker/buildx/releases -ARG DOCKER_BUILDX_VERSION="0.5.1" +ARG DOCKER_BUILDX_VERSION="0.10.4" # https://github.com/awslabs/amazon-ecr-credential-helper/releases -ARG DOCKER_AWS_ECR_CREDENTIAL_HELPER_VERSION="0.5.0" +ARG DOCKER_AWS_ECR_CREDENTIAL_HELPER_VERSION="0.6.0" # https://github.com/docker/docker-credential-helpers/releases -ARG DOCKER_PASS_CREDENTIAL_HELPER_VERSION="0.6.3" +ARG DOCKER_PASS_CREDENTIAL_HELPER_VERSION="0.7.0" # install docker buildx RUN wget "https://github.com/docker/buildx/releases/download/v${DOCKER_BUILDX_VERSION}/buildx-v${DOCKER_BUILDX_VERSION}.linux-amd64" && \ @@ -27,11 +27,9 @@ RUN wget "https://github.com/docker/buildx/releases/download/v${DOCKER_BUILDX_VE mv docker-credential-ecr-login /usr/local/bin/docker-credential-ecr-login && \ chmod a+x /usr/local/bin/docker-credential-ecr-login && \ # install docker pass credential helper - wget "https://github.com/docker/docker-credential-helpers/releases/download/v${DOCKER_PASS_CREDENTIAL_HELPER_VERSION}/docker-credential-pass-v${DOCKER_PASS_CREDENTIAL_HELPER_VERSION}-amd64.tar.gz" && \ - tar -xvf "docker-credential-pass-v${DOCKER_PASS_CREDENTIAL_HELPER_VERSION}-amd64.tar.gz" && \ + wget "https://github.com/docker/docker-credential-helpers/releases/download/v${DOCKER_PASS_CREDENTIAL_HELPER_VERSION}/docker-credential-pass-v${DOCKER_PASS_CREDENTIAL_HELPER_VERSION}.linux-amd64" >> "docker-credential-pass" && \ mv docker-credential-pass /usr/local/bin/docker-credential-pass && \ - chmod a+x /usr/local/bin/docker-credential-pass && \ - rm "docker-credential-pass-v${DOCKER_PASS_CREDENTIAL_HELPER_VERSION}-amd64.tar.gz" + chmod a+x /usr/local/bin/docker-credential-pass COPY scripts/gitlab-docker-registry-login.sh /usr/local/bin/gitlab-docker-registry-login COPY scripts/docker-registry-login.sh /usr/local/bin/docker-registry-login diff --git a/README.md b/README.md index 94f01e0..d255943 100644 --- a/README.md +++ b/README.md @@ -13,18 +13,18 @@ docker-compose build --pull ### Docker only ```sh -DOCKER_VERSION="20.10.5" -DOCKER_BUILDX_VERSION="0.5.1" -DOCKER_AWS_ECR_CREDENTIAL_HELPER_VERSION="0.5.0" +DOCKER_VERSION="23.0.2" +DOCKER_BUILDX_VERSION="0.10.4" +DOCKER_AWS_ECR_CREDENTIAL_HELPER_VERSION="0.6.0" docker build --pull --build-arg "DOCKER_VERSION=$DOCKER_VERSION" \ --build-arg "DOCKER_BUILDX_VERSION=$DOCKER_BUILDX_VERSION" \ --build-arg "DOCKER_AWS_ECR_CREDENTIAL_HELPER_VERSION=$DOCKER_AWS_ECR_CREDENTIAL_HELPER_VERSION" \ - --tag "registry.gitlab.com/swoole-bundle/docker-client:$DOCKER_VERSION" . + --tag "docker.io/pixelfederation/docker-client:$DOCKER_VERSION" . -docker run --rm -ti -v "/var/run/docker.sock:/var/run/docker.sock" "registry.gitlab.com/swoole-bundle/docker-client:$DOCKER_VERSION" info +docker run --rm -ti -v "/var/run/docker.sock:/var/run/docker.sock" "docker.io/pixelfederation/docker-client:$DOCKER_VERSION" info ``` -docker push registry.gitlab.com/swoole-bundle/docker-client +docker push docker.io/pixelfederation/docker-client ## GitLab Examples @@ -33,7 +33,7 @@ docker push registry.gitlab.com/swoole-bundle/docker-client ```yaml build-docker-image: stage: build - image: registry.gitlab.com/swoole-bundle/docker-client:latest + image: docker.io/pixelfederation/docker-client:latest variables: DOCKER_TLS_CERTDIR: /certs DOCKER_BUILDX_CONTEXT_CREATE: "1" @@ -56,7 +56,7 @@ build-docker-image: ```yaml build-docker-image: stage: build - image: registry.gitlab.com/swoole-bundle/docker-client:latest + image: docker.io/pixelfederation/docker-client:latest variables: DOCKER_TLS_CERTDIR: /certs AWS_ACCOUNT_ID: xxxxx @@ -64,7 +64,7 @@ build-docker-image: AWS_ACCESS_KEY_ID: xxxxx AWS_SECRET_ACCESS_KEY: xxxxx services: - - docker:20.10.5-dind + - docker:23.0.2-dind before_script: - aws-ecr-login script: @@ -77,11 +77,11 @@ build-docker-image: ```yaml build-docker-image: stage: build - image: registry.gitlab.com/swoole-bundle/docker-client:latest + image: docker.io/pixelfederation/docker-client:latest variables: DOCKER_TLS_CERTDIR: /certs services: - - docker:20.10.5-dind + - docker:23.0.2-dind before_script: - gitlab-docker-registry-login script: diff --git a/docker-compose.yml b/docker-compose.yml index fc90d62..ca9fe54 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,11 +2,11 @@ version: "3.9" x-aliases: - &DEFAULT_ARGS - DOCKER_VERSION: ${DOCKER_VERSION:-20.10.5} - DOCKER_COMPOSE_VERSION: ${DOCKER_COMPOSE_VERSION:-1.29.0} - DOCKER_BUILDX_VERSION: ${DOCKER_BUILDX_VERSION:-0.5.1} - DOCKER_AWS_ECR_CREDENTIAL_HELPER_VERSION: ${DOCKER_AWS_ECR_CREDENTIAL_HELPER_VERSION:-0.5.0} - DOCKER_PASS_CREDENTIAL_HELPER_VERSION: ${DOCKER_PASS_CREDENTIAL_HELPER_VERSION:-0.6.3} + DOCKER_VERSION: ${DOCKER_VERSION:-23.0.2} + DOCKER_COMPOSE_VERSION: ${DOCKER_COMPOSE_VERSION:-2.17.2} + DOCKER_BUILDX_VERSION: ${DOCKER_BUILDX_VERSION:-0.10.4} + DOCKER_AWS_ECR_CREDENTIAL_HELPER_VERSION: ${DOCKER_AWS_ECR_CREDENTIAL_HELPER_VERSION:-0.6.0} + DOCKER_PASS_CREDENTIAL_HELPER_VERSION: ${DOCKER_PASS_CREDENTIAL_HELPER_VERSION:-0.7.0} volumes: dind-ca: {} @@ -18,7 +18,7 @@ networks: services: local: - image: ${REGISTRY:-registry.gitlab.com}/${NAMESPACE:-swoole-bundle}/${PROJECT_NAME:-docker-client}-local:${IMAGE_TAG:-local} + image: ${REGISTRY:-docker.io}/${NAMESPACE:-pixelfederation}/${PROJECT_NAME:-docker-client}-local:${IMAGE_TAG:-local} build: context: . target: "${TARGET:-client}" @@ -29,7 +29,7 @@ services: - ./examples:/workspace:ro dind: - image: docker.io/docker:${DOCKER_VERSION:-20.10.5}-dind + image: docker.io/docker:${DOCKER_VERSION:-23.0.2}-dind restart: always privileged: true environment: @@ -44,7 +44,7 @@ services: - dind remote: - image: ${REGISTRY:-registry.gitlab.com}/${NAMESPACE:-swoole-bundle}/${PROJECT_NAME:-docker-client}-remote:${IMAGE_TAG:-local} + image: ${REGISTRY:-docker.io}/${NAMESPACE:-pixelfederation}/${PROJECT_NAME:-docker-client}-remote:${IMAGE_TAG:-local} depends_on: - dind build: @@ -66,6 +66,6 @@ services: - dind example-nginx: - image: ${REGISTRY:-registry.gitlab.com}/${NAMESPACE:-swoole-bundle}/${PROJECT_NAME:-docker-client}-example-nginx:${IMAGE_TAG:-local} + image: ${REGISTRY:-docker.io}/${NAMESPACE:-pixelfederation}/${PROJECT_NAME:-docker-client}-example-nginx:${IMAGE_TAG:-local} build: context: examples/nginx