0
1

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

dockerでgnu screenを使う

Last updated at Posted at 2021-10-20

初めまして。くろんです。

Dockerでgnu screenを使おうとして、
普段と違う画面が出て困ったので原因を調べました。

普段の画面はこんなの

image.png

今回出てきた画面

  1. docker run -it ubuntu:20.04 bash
  2. apt update && apt install -y screen
  3. screen

image.png
補完が使えないし色々不便

原因

ここを見るに環境変数の SHELL に値が入っていないと /bin/sh になるらしい
https://linuxjm.osdn.jp/html/GNU_screen/man1/screen.1.html
image.png
実際見てみると /bin/sh になってる

export SHELL=/bin/bash をDocker内にて設定して screen してみる
image.png
普段の画面が出ました。

Dockerfile とかで設定する場合には ENV SHELL /bin/bash あたりすればOK

サンプル

FROM ubuntu:20.04

# for gnu screen
ENV SHELL /bin/bash

RUN apt-get update && apt-get install -y \
    screen \
    && rm -rf /var/lib/apt/lists/*

では

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?