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.

  • influxDB and cadvisor integration issue
  • Dockerized selenium browser cannot access Capybara test url
  • mounted directory on host does not work or access docker container
  • ASP.NET Core 1.0 RC1 Docker with dnu publish
  • Is it possible to send string into running process inside docker container?
  • What are the disadvantages of a Docker container using the host network?
  • 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.

  • Install nginx dynamic module using docker compose
  • The command '/bin/sh returned a non-zero code: 1
  • What does |1 mean in Docker history
  • Docker - AWS - What do I need to do next?
  • How many docker containers can i run simultaneously on single host?
  • Howto run a Prestashop docker container with persistent data?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.