Tag: bash

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 beta for Windows and Windows Bash: path must be absolute

When I try to run Docker container using windows bash, I’ve got this error: “path must be absolute”, but using Power Shell everything works fine. Is this a bug or I’m doing it wrong??

How to run multiple Docker Containers in different terminals using Docker compose or with Shell?

I have to pull docker image from Docker Hub and start running multiple peers as containers. now, I am manually opening terminal and executing my docker run command on downloaded image but I am planning to automate this process like if I/user want 2 peers to run then I should be able to provide IP […]

Linux – Docker MySQL Image – CREATE MYSQL_USER

I am new to docker containers, and I am working on automating some MySQL tasks. By using bash scripts I am able to automate the creation and dump of Databases but now i am trying to create the new user getting input from the command line and it is not working. this is my script: […]

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 […]

Send “sigterm” from Java to Bash script

I am starting a Java code from Bash script called start.sh. The Bash script fires up the Java code and then the Java code runs. At the end of the Java program, I want to send a signal back to the Bash script to terminate. Keep in mind that the Bash script runs with PID […]

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