Tag: bash

Build Docker image only if Code Repository has been updated (Jenkins)

Currently, in a Jenkins job, I build a Docker image with files from a git repository. When this repository is changed/updated I would like to either: Be able to detect this in Jenkins so I can change my Bash script to rebuild the Docker image from my Dockerfile Find some other method of building my […]

How to run a CMD and open Bash when running a docker container?

I am having a rough time trying to figure this out. So I have a dockerfile based on an Ubuntu image. At the end of my dockerfile I have: CMD django-admin startproject $PROJECTNAME I was told in a previous post that the base Ubuntu image has a CMD to run /bin/bash so my command is […]

Dockerfile for Rails app – Permission Denied

I am attempting to create a docker image of a rails app using rvm (as non-root) and am running into permission errors: Dockerfile: FROM ubuntu RUN apt-get update -q RUN apt-get install -qy curl RUN apt-get install -y libpq-dev RUN apt-get install -y imagemagick –fix-missing RUN apt-get install -y curl patch gawk g++ gcc make […]

Send a command into a running docker

I’m trying to start oracle lsnrctl in a running server. Here is my command (run from host server): until [ ! -z `docker exec -it my_docker bash -c “lsnrctl start” | grep successfully`]; do echo “init_demo: waiting for TNS listener to start”;sleep 0.1;done The output is an infinity loop of: init_demo: waiting for TNS listener […]

`docker attach` command can't enter into a container unless Ctrl+C or Enter pressed

I run docker using command: docker run -p 3000:3000 -it -v $(pwd):/home/root/qadev/ –name loquat bar-qadev-base:latest /bin/bash then I can enter into container automatically. Minutes later I pressed ctrl+d or ctrl+p+q to exit it. Now I would like to enter into this loquat container again by issuing command: docker start loquat docker attach loquat But the […]

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

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