Tag: bash

Recursive while loop in docker cmd

I’m trying to run google chrome inside docker containers. I have been able to successfully do so, however there have been instances where chrome would not run on some of the containers (mass creation of containers). So I’m looking to run a while loop till the chrome process is found to be running. I’ve tried […]

Running Docker Commands with a bash script inside a container

I’m trying to automate deployment with webhooks to the Docker hub based on this tutorial. One container runs the web app on port 80. On the same host I run another container that listens for post requests from the docker hub, triggering the host to update the webapp image. The post request triggers a bash […]

running iptables with rhel7.2 image with in docker

while running iptables inside docker with rhel7.2 image it is working fine. But when I am trying to run docker with some rules to it then it is not at all starting. Here is my docker file #######Simplest Docker file which I used for building image and it works from marathon if you dont give […]

Oracle Java in Docker Container cannot resolve hostname after /etc/nsswitch.conf changed

I was minimizing Oracle-JRE 8 Docker Image to deploy my own playframework app. Host: CentOS 7 minimal + Oracle JRE 8 The steps are as following: Create bash docker image with busybox, since playframework generate bash based startup scripts. I built bash binaries, and use ldd /bin/bash to find related lib so files, and ADD […]

mysqldump does not dump everything when running in script

I have a mysql server running in a docker container named dockersql. To backup it, I use docker run -ti –rm –link dockersql:mysql -v $HOME/backups/20160202/:/hostbackup mysql /bin/bash -c “mysqldump -u user -p -h mysql database > /hostbackup/mysqldump.sql” This works fine. I have include this same line inside a shell backup script which does other stuff. […]

Unable to run shell command with docker?

I have installed docker on Ubuntu 14.04. Now when i am trying to create one test job in docker, i am getting the below error: $ sample_job=$(docker run -d busybox /bin/sh -c “while true; do echo Docker; sleep 1; done”) –bash: command substitution: line 228: syntax error near unexpected token `do’ -bash: command substitution: line […]

Escaping Docker attach one started from bash script

I’m running Docker commands from a management script and one of the commands I use is attach. Attaching works fine but I can’t seam to leave the output either by pressing CTRL+C or CTRL+P/CTRL+Q. My theory is that the key signals are not fetched by Docker since bash is running front of it. Is this […]

docker run -it bash -c 'Function from sourced file'

I have a file with couple of functions inside a docker container. I want to run: docker run -it 06b68ae1c601 bash -c ‘function1′ but the output is ‘/bin/bash: function1: command not found” I have placed ‘source /pathtofile’ in /root/.bashrc, /root/.profile /etc/bash.bashrc but the file is still not sourced. Also tried to run bash –login option, […]

nginx not starting inside Docker [duplicate]

This question already has an answer here: Dockerized nginx is not starting 4 answers

Redirect several log files in docker container to stdout (legacy application)

I have to put legacy application into Docker container. The app is running fine but I cannot display all the log files. The problem is that the app is creating several log files (e.g. service.log, license.log, security.log etc.) AFTER starting the executable. I have a starting script (let’s call it start.sh) which prepares some things […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.