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.

dockerを一般ユーザーで実行できる様にする

Posted at

目的

本番環境でやたらrootで操作するのは良くない。
dockerを一般ユーザーから操作出来る様になろう

手順

docker グループの確認

dockerをインストールすれば出来ているはず

$ cat /etc/group | grep docker
docker:x:112:

dockerグループにユーザーを追加する

$ sudo usermod -aG docker ユーザー名

確認

$ groups ユーザー名

ログインしなおす

$ exit

dockerを実行してみる

$ docker

Usage:  docker [OPTIONS] COMMAND

A self-sufficient runtime for containers

Common Commands:
  run         Create and run a new container from an image
  exec        Execute a command in a running container
  ps          List containers
  build       Build an image from a Dockerfile
  pull        Download an image from a registry
  push        Upload an image to a registry
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?