Ben Chuanlong Du's Blog

It is never too late to learn.

Shell in Docker

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Configure the Shell for the RUN Command

https://docs.docker.com/engine/reference/builder/#shell

Configure the Default Shell for Terminals in Docker Containers

Just set the SHELL environment variable in …

Functions in Bash

By default, variables defined in a function are global, i.e., they are visible outside the function too.

File Name of Bash Script

  1. Do NOT get into this messy shit if you can avoid it! Use Python script instead if you can.

  2. If you want to reliably get the name of a Bash script, it is recommended that you run the Bash script as an executable script instead of source it in.