1
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でサクッと検証環境を作成する方法

Last updated at Posted at 2023-11-02

ローカル環境を汚さずに環境を作って挙動を試したいみたいなことが増えたのでそれを実現する

ディレクトリ構成

.
└── Dockerfile
docker build -t almalinux-practice
#-tオプションを使用してイメージに名前をつける
docker run -it almaliinux-practice /bin/bash
#一つまえのコマンドで作成したイメージからコンテナを作成してそのコンテナに入る

下みたいな画面になればOK

[root@xxxxxxxxxx /]# ls
afs  bin  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var

あとはnode入れたり使ってみたいもの入れるとローカルは汚さずにいろいろ試すことが可能。

まとめ

Docker使えばいろんな環境作成できてかなり便利。
ただOSを入れる場合最小構成が入ってしまうみたい(psコマンドがなかったり)少し不便なとこはあるのでこの辺テンプレにできたらいいなーとか思ったりした。

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