2024年5月17日星期五

[AWS EC2]Docker install

AWS EC2にDockerを利用して、Wordpressを使い始めたいと思いますので、AWS EC2にDockerインストールをメモしておきます。

1. EC2インスタンスにログインして、最新のyumリストを取得します。

$ sudo yum update -y

2. Docker packageインストールします。

$ sudo yum install -y docker

3. Dockerサービスを起動します。

$ sudo service docker start
Redirecting to /bin/systemctl start docker.service

4. Dockerグループにec2-userを追加します。

$ sudo usermod -a -G docker ec2-user

5. 一旦ログアウトして、再度ログインすることで、設定を有効化します。docker infoでdockerの起動を確認します。

exit

$ docker info
Client:
 Version:    25.0.3
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.0.0+unknown
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx

Server:
...
Although we did not face below issue, if you have the problem, please follow AWS guidance to restart the instance.

Cannot connect to the Docker daemon. Is the docker daemon running on this host?


The blog is follow on AWS guidance. Amazon ECS で使用するコンテナイメージの作成

没有评论:

发表评论