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.

  • How to set environment variable as docker image name on build
  • Multiple projects in one solution to generate one docker container
  • How do I select the master Redis pod in this Kubernetes example?
  • Can use kubectl replace update the namespace of service in kubernetes
  • Docker's container mount folder
  • Can't access docker-machine IP on Windows
  • so, tl;dr: how can I achieve something like this in my Dockerfile

    #dockerfile
    RUN bash --login
    RUN some-script
    

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

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

  • replication controller in docker swarm world
  • docker kill and capturing logs or buffers
  • Entity framework 7 with Microsoft SQL server not working in Docker
  • How to download base docker image for creating hello world docker image?
  • stop a database container in docker automatically
  • Docker Swarm container reachable although port is not open?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.