how to pass a –login into docker build

I have some script that I need to run inside the container, and somehow it only run if I run it inside a bash --login.
I normally run my docker: docker build -t sometags . and I noticed it only run bash without --login.

I know I can just use bash -l -c "some-command-here" but I’d say it’s my final fallback if nothing can helps.

  • What is Docker storage driver
  • Docker: Unable to correct problems, you have held broken packages
  • Dockerized Django with webpackDevServer
  • Pulling images from private registry in Kubernetes
  • Docker API start container returns 404
  • Dockerfile: is it possible to reference overridden entrypoint and cmd?
  • so, tl;dr: how can I achieve something like this in my Dockerfile

    RUN bash --login
    RUN some-script

    and then, I’ll just run it with: docker build -t x/y:z .

    the scripts I want to run is things like: gem install bundler, and bundle install.

  • run netflixoss docker on windows 8.1
  • How do I deploy this docker app on digital ocean?
  • Docker nginx minitet
  • How can I rate limit network traffic on a docker container
  • How to see the logs of running application inside docker container?
  • Limit disk size and bandwidth of a Docker container
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.