$ docker container ls CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 65b5af36d7ac centos:mariadb0001 "/mariadb.sh" 4 days ago Up 4 days 3306/tcp mariadb0001
$ docker container ls CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a4d1693a7981 centos:mw0001 "/sbin/init" 3 hours ago Up 3 hours mw0001 65b5af36d7ac centos:mariadb0001 "/mariadb.sh" 4 days ago Up 4 days 3306/tcp mariadb0001
$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1ad8c112f237 centos:mariadb0001 "/bin/sh -c ['/maria…" 3 seconds ago Exited (127) 3 seconds ago mariadb0001
Exited…止まってしまっています…
起動しない原因の調査
まずはログをみてみます。
1 2
$ docker logs 1ad8c112f237 /bin/sh: [/mariadb.sh]: No such file or directory
$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 65b5af36d7ac centos:mariadb0001 "/mariadb.sh" 20 seconds ago Up 19 seconds 3306/tcp mariadb0001
class CreateDocumentView < ActiveRecord::Migration def change create_table :document_views do |t| t.references :document_base, index: true, foreign_key: { name: 'document_base_id_on_document_views' } t.timestamps end end end
class CreateDocumentView < ActiveRecord::Migration def change create_table :document_views do |t| t.references :document_base, index: true, foreign_key: { name: 'document_base_id_on_document_views', column: :document_base_id } t.timestamps end end end
$ docker image build -f Dockerfile -t al2_nginx:latest . Sending build context to Docker daemon 2.048kB Step 1/3 : FROM amazonlinux:latest ---> 7f335821efb5 Step 2/3 : RUN yum update -y ---> Using cache ---> b36e0bbfc4cf Step 3/3 : RUN amazon-linux-extras install nginx1.12 ---> Running in de67234984e9 NOTE: The livepatch extra is in public preview, not meant for production use
Topic nginx1.12 has end-of-support date of 2019-09-20 Loaded plugins: ovl, priorities Cleaning repos: amzn2-core amzn2extra-nginx1.12 (中略) * Extra topic has reached end of support. Removing intermediate container de67234984e9 ---> 97bc3952d1a8 Successfully built 97bc3952d1a8 Successfully tagged al2_nginx:latest
$ docker image build -f Dockerfile -t al2_nginx:latest . Sending build context to Docker daemon 2.048kB Step 1/3 : FROM amazonlinux:latest ---> 7f335821efb5 Step 2/3 : RUN yum update -y ---> Using cache ---> b36e0bbfc4cf Step 3/3 : RUN amazon-linux-extras install nginx1 ---> Running in a7280e4e4c82 NOTE: The livepatch extra is in public preview, not meant for production use