LoginSignup
0
1

More than 3 years have passed since last update.

[docker]入門 alpine linuxを起動してみた (windows編)

Last updated at Posted at 2020-08-12

今後,dockerを使いこなすために触ってみました.

dockerのversion

一応,versionを記載しておきます.

C:\Users\mtani\docker>docker -v
Docker version 19.03.12, build 48a66213fe

alpine linuxのダウンロード

alpine linuxをpullしてきます.

C:\Users\mtani\docker>docker pull alpine:3.12.0
3.12.0: Pulling from library/alpine
df20fa9351a1: Pull complete                                                                                                                 Digest: sha256:185518070891758909c9f839cf4ca393ee977ac378609f700f60a771a2dfe321
Status: Downloaded newer image for alpine:3.12.0
docker.io/library/alpine:3.12.0

C:\Users\mtani\docker>docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
alpine              3.12.0              a24bb4013296        2 months ago        5.57MB

alpine linuxの起動

idを指定してalpine linuxを起動させます.-itdでバックグラウンド起動させます.

C:\Users\mtani\docker>docker run -itd --name alpine1 a24bb4013296
35481c15481cc36bf2d13341cfd578f5793758347da89601eca488549b838b31

C:\Users\mtani\docker>docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
35481c15481c        a24bb4013296        "/bin/sh"           2 seconds ago       Up 1 second                             alpine1

docker execでalpine linuxに入ります.

C:\Users\mtani\docker>docker exec -it alpine1 /bin/sh
/ # ls
bin    dev    etc    home   lib    media  mnt    opt    proc   root   run    sbin   srv    sys    tmp    usr    var
/ # 

まとめ

今回はalpine linuxのダウンロードから起動まで.
次回はalpine linuxをカスタマイズしてイメージに焼きたいと思います.
次回は開発に便利なVScodeとの連携をしていきます.

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