Tag: bash

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

Send keystroke to Dockerfile, Ubuntu

I’m creating Dockerfile script and it has a command line that executes a program and requires user input 1 from keyboard as selected option to go to further steps. Xdotool, man yes or expect cannot help in this situation. Update source-code: First off, download and extract RevoMath library, navigate to RevoMath folder then execute the […]

Run Clean-up Logic on Docker Container's Shutdown/Killing?

Given: Host machine Docker container running web service I’d like to implement “clean-up” logic upon the shutdown of the web service. It seems to me that there’s 2 ways to do this: 1. [On Dockerfile’s ENTRYPOINT] Use trap per the docs trap “echo TRAPed signal” HUP INT QUIT KILL TERM /usr/sbin/apachectl start 2. [On Host] […]

ADD command not working Docker

FROM phusion/baseimage:0.9.16 MAINTAINER Raheel <raheelwp@gmail.com> RUN apt-get update RUN apt-get -y install apache2 libapache2-mod-php5 curl git RUN add-apt-repository ppa:ondrej/php5-5.6 RUN apt-get update RUN apt-get -y install python-software-properties RUN apt-get update RUN apt-get -y –force-yes install php5 php5-cli php5-mcrypt php5-curl php5-xdebug php5-json RUN apt-get clean RUN php5enmod mcrypt RUN rm -rf /var/www/html RUN curl -sS https://getcomposer.org/installer […]

docker-compose not found from script

I have a Dockerfile which is basically the following: FROM mhart/alpine-node:5 COPY . /project WORKDIR /project ENTRYPOINT [“./startup.sh”] And my startup.sh is quite simple too: #!/bin/sh set -e docker-compose up -d I do have a docker-compose.yml, but there is no point to describe it here. First thing I do is to build the docker image […]

Passing Masked Jenkins Environment Variable to Docker container

I have a password parameter set in my Jenkins build containing some information I want kept secret. The Jenkins build will create a Docker container which needs access to this parameter. Currently, my command looks like such: docker run -e PASSWORD=${PASSWORD} my_image my_command This works as I expected it to–the PASSWORD parameter I have set […]

Copy apidoc files from dokku container to host apache folder

I have a dokku REST app running, and I am using http://apidocjs.com/ to generate my api documentation. The thing is i have it hosted in a digitalocean droplet. And i would like to have a bash script or something that: 1.- Executes the apidoc command 2.- Copies all of the generated files from the container […]

Use gcloud with docker

Trying to install gsutil into a container to do backups into google cloud storage. When I install things manually into the container it works fine, but when try to automate it with a build I keep getting bash: gcloud: command not found What am I doing wrong? ##Dockerfile## FROM node:5 #RUN rm /bin/sh && ln […]

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