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 …

User in Docker

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

User switching in Docker

  1. USER some_user in Dockerfile, some_user has to exists
  2. su in Dockerfile or shell scripts
  3. docker run --user some_user

@pedrolucasoliva i am docker specialist i give you a …

Erase Elements of a Container Using Iterator in C++

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

@TODO: make a general discuss about removing elements form containers ...

vector -> best to remove backwards ...

You cannot erase elements from a container using the function std::for_each or the range-based for …

For Loops in C++

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

There are 3 for loops in C++, the usual for loop, the range-based for loop (introduced in C++11) and the std::for_each for loop.

  1. Both the range-based for loop and …