Tag: bash

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

What is the correct command needed to execute my python app in my dockerfile?

I’m using continuum’s anaconda3 docker image. However, I can’t figure out what I need to do in my docker-compose file to have my app run. Currently, when I run docker-compose up, my database will connect, but then the service web exits and will say that the path to app.py doesn’t exist: python: can’t open file […]

script if version in package.json has changed

I have a npm module project that also provides a docker image. I want to trigger the build/test/push of a docker image when package.json version changes. I’m after a bash script that will identify whether the version in my package.json has changed. I can tell if the file has changed with something such as $(git […]

Custom Installer for Unix Platform to install Python, Java, MySQL

We need to distribute a tool which is developed using Python, Java and MySQL as database in a distributable format. So if end user is installing our tool, we check for Python, and if it not exists then we would install Python from the disk and not from apt-get. The process repeats for Java and […]

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