LoginSignup
1
0

More than 1 year has passed since last update.

dockerのmysqlのコンテナのビルドで失敗した際の解決方法

Posted at

先日、新しいプロジェクトにも手を付けることになったので環境構築を行なっていたところ、mysqlのdockerコンテナのビルドに失敗したので、その解決方法です。
プロジェクトの中身を見てみたところ、ローカル環境でサーバを起動するとかそんなお話だったので、Macで環境構築するのもめんどくさいし、docker環境でも整備しようとして起きたエラーがこちらになります。

=> ERROR [2/3] RUN apt update                                                                                    5.1s
------                                                                                                                 
 > [2/3] RUN apt update:                                                                                               
#6 0.335                                                                                                               
#6 0.335 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.                               
#6 0.335                                                                                                               
#6 0.562 Get:1 http://security.debian.org/debian-security stretch/updates InRelease [53.0 kB]
#6 0.571 Ign:2 http://deb.debian.org/debian stretch InRelease
#6 0.595 Get:3 http://repo.mysql.com/apt/debian stretch InRelease [21.6 kB]
#6 0.639 Get:4 http://deb.debian.org/debian stretch-updates InRelease [93.6 kB]
#6 0.765 Get:5 http://deb.debian.org/debian stretch Release [118 kB]
#6 0.801 Get:6 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [771 kB]
#6 0.846 Get:7 http://deb.debian.org/debian stretch Release.gpg [3177 B]
#6 0.866 Err:3 http://repo.mysql.com/apt/debian stretch InRelease
#6 0.866   The following signatures were invalid: EXPKEYSIG 8C718D3B5072E1F5 MySQL Release Engineering <mysql-build@oss.oracle.com>
#6 1.246 Get:8 http://deb.debian.org/debian stretch/main amd64 Packages [7080 kB]
#6 4.370 Reading package lists...
#6 4.990 W: GPG error: http://repo.mysql.com/apt/debian stretch InRelease: The following signatures were invalid: EXPKEYSIG 8C718D3B5072E1F5 MySQL Release Engineering <mysql-build@oss.oracle.com>
#6 4.990 E: The repository 'http://repo.mysql.com/apt/debian stretch InRelease' is not signed.
------
failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c apt update]: exit code: 100

Dockerfileの中身はこんな感じです。

FROM mysql:5.6

RUN apt update
RUN apt install -y openssh-server vim

調べてみると、証明書が切れてるとのことでした。

証明書を更新してもいいのですが、dockerファイルにいちいち記載したりするのもやだし、必ずしも他の人の環境でも起きることでもないなと考えて、aptではなくapt-getを使うことにしました。

修正したDockerfileはこんな感じです。

FROM mysql:5.6

RUN apt-get update
RUN apt-get install -y openssh-server vim

こんな感じでやったら無事に立ち上がりました。

元の記事

1
0
1

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
1
0