7
6

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 5 years have passed since last update.

Docker で ubuntu18.04 を使ってみた

Posted at

はじめに

ubuntuはよく使うので備忘録がてら投稿(重要な点のみ記載してます)

環境

本記事は以下の環境等を使用しております。

環境 Version
Windows 10(64bit)
Ubuntu 18.04(64bit)

前準備

Windows:Docker環境が使用可能であること

ubuntu18.04コンテナを起動する

terminal
# 簡略版
# コンテナの起動
docker run --name temp_ubuntu1804 -itd ubuntu:18.04 /bin/bash
terminal
# 通常版
# コンテナイメージの取得
docker pull ubuntu:18.04
# 取得したイメージの一覧表示
docker images
# コンテナの起動
docker run -itd <image id> /bin/bash

コンテナに接続

terminal
# 簡略版
# コンテナに接続
docker exec -it temp_ubuntu1804 /bin/bash
terminal
# 通常版
# コンテナの確認
docker ps -a
# コンテナに接続
docker exec -it <container id | container name> /bin/sh

※docker attach <container id | container name> を
 使用することも可能ですがattachした場合exitで
 コンテナ終了してしまう+接続は別プロセスが好ましいと考えるので
 私はexecを使います

インストール済みのパッケージを更新、表示

terminal
apt -y update
apt -y upgrade
apt list

最後に

とりあえずubuntuの起動まで。

7
6
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
7
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?