0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

dynamodb-localのdockerイメージにマニフェストがなくてGitLabのCIが失敗した

Last updated at Posted at 2023-02-10

結論から先に

Dockerイメージを1.20.0以下に固定する
amazon/dynamodb-local:1.20.0

docker-composer.yml
version: "3"
services:
    dynamodb:
      image: amazon/dynamodb-local:1.20.0
    ...

現象

gitlab-runnerのログ(抜粋)

$ docker-compose -f docker-compose-ci.yml up -d
Creating network "orpheanalyticsserverapi_default" with the default driver
Pulling db (mysql:5.7)...
5.7: Pulling from library/mysql
Digest: sha256:8cf035b14977b26f4a47d98e85949a7dd35e641f88fc24aa4b466b36beecf9d6
Status: Downloaded newer image for mysql:5.7
Pulling dockerize (jwilder/dockerize:0.6.1)...
0.6.1: Pulling from jwilder/dockerize
Digest: sha256:5712c481002a606fffa99a44526fbff2cd1c7f94ca34489f7b0d6bbaeeff4aa4
Status: Downloaded newer image for jwilder/dockerize:0.6.1
Pulling dynamodb (amazon/dynamodb-local:latest)...
latest: Pulling from amazon/dynamodb-local
mediaType in manifest should be 'application/vnd.docker.distribution.manifest.v2+json' not 'application/vnd.oci.image.manifest.v1+json'
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit code 1

原因

mediaTypeがマニフェストに必要だが見つからない

docker manifestとは

  • イメージに関するレイヤー、サイズ、ダイジェスト値に加えて、イメージがビルド対象とした OS やアーキテクチャーなどの情報

解決するまでのステップ

  • GitLabのCIのログを見ると latest: Pulling from amazon/dynamodb-local で止まっているので、dynamodb-localのイメージが怪しいと判断した。
  • マニフェストがどうなっているか確認
    • マニフェストがそもそも見つからない
    $ docker manifest inspect --insecure amazon/dynamodb-local:latest
    no such manifest: docker.io/amazon/dynamodb-local:latest
    
  • ひとつ前のバージョンを確認
    • マニフェストが表示された。mediaTypeもある。
    $ docker manifest inspect --insecure amazon/dynamodb-local:1.20.0
    {
      "schemaVersion": 2,
      "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
      "manifests": [
         {
            "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
            "size": 1160,
            "digest": "sha256:ba8d8489ab2d68434b53cd3f2d13a6d05db8b3a295572957104a2e4851812e21",
            "platform": {
               "architecture": "arm64",
               "os": "linux"
            }
         },
         {
            "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
            "size": 1160,
            "digest": "sha256:aed85599f5000979c28c8b2fea7d685a0f2c60810df819973b1fb8e8dc5d7206",
            "platform": {
               "architecture": "amd64",
               "os": "linux"
            }
         }
      ]
    }
    

※ docker manifest inspectが権限エラーになる場合は、docker loginが必要です。

latest(1.20.1)になぜmanifestが存在しないのかは不明。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?