LoginSignup
1
7

More than 3 years have passed since last update.

Docker で alpine を使ってみた

Last updated at Posted at 2019-06-15

はじめに

alpine使うことが増えてきたので
備忘録がてら投稿(重要な点のみ記載してます)

環境

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

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

前準備

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

alpineコンテナを起動する

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

コンテナに接続

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

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

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

terminal
apk update
apk upgrade
apk info

最後に

まずはalpineの起動まで。
これをベースに色々試していこうかな。

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