Tag: bash

Jenkins – Cannot run program “docker”

Trying to use a docker agent with a declarative pipeline… pipeline { agent { docker { image ‘rubygem/calabash-cucumber’ } } … The build job finds the docker image but then skips all stages and quits with a Java exception: [test_automation] Running shell script + docker pull rubygem/calabash-cucumber Using default tag: latest latest: Pulling from rubygem/calabash-cucumber […]

How Can I Get Mitmproxy Docker to Work on Windows Bash?

When I try running mitmproxy Docker container on Windows bash, I get an error message that the Docker daemon isn’t running. How can I get it to run? docker run –rm -it -p 8080:8080 mitmproxy/mitmproxy docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?.

Unable to run shell script using dockerfile

I am new to docker and I just wanted to copy the shellscript inside the container and I wanted to execute the shellscript. Dockerfile: FROM amazonlinux WORKDIR /opt ADD ./test_Install.sh /opt/test_Install.sh RUN chmod 777 /opt/test_Install.sh WORKDIR / RUN ./test_Install.sh Build image: docker build -t “testinstallscript:dockerfile” . When I use the command “docker build -t “testinstallscript:dockerfile” […]

Kubernetes: how to debug CrashLoopBackOff

I have the following setup: A docker image omg/telperion on docker hub A kubernetes cluster (with 4 nodes, each with ~50GB RAM) and plenty resources I followed tutorials to pull images from dockerhub to kubernetes SERVICE_NAME=telperion DOCKER_SERVER=”https://index.docker.io/v1/” DOCKER_USERNAME=username DOCKER_PASSWORD=password DOCKER_EMAIL=”omg@whatever.com” # Create secret kubectl create secret docker-registry dockerhub –docker-server=$DOCKER_SERVER –docker-username=$DOCKER_USERNAME –docker-password=$DOCKER_PASSWORD –docker-email=$DOCKER_EMAIL # Create service […]

xhost command for docker GUI apps (Eclipse)

I’m looking at running a GUI app in docker. I’ve heard that this is incurs security problems due to the Xserver being exposed. I’d like to know what is being done in each of the following steps, specifically the xhost local:root: [ -d ~/workspace ] || mkdir ~/workspace xhost local:root docker run -i –net=host –rm […]

How can I set .bash_profile environment variable in Dockerfile?

I want to set bash environment variable in Dockerfile. How I can do it? Host: OS X 10.11.4 Guest: ubuntu:latest Dockerfile: RUN mkdir ~/gopath_dir RUN apt-get install ubuntu-make RUN umake go # I want to set $GOPATH to ~/gopath_dir

Pass Docker ENV variable to rails app

I am testing a rails app utilizing a docker container. What I am trying to do is pass an ENV variable at run using the -e flag like so: docker run -p 3000:3000 -d -e “DOCKER_HOST=$(ip -4 addr show docker0 | grep -Po ‘inet \K[\d.]+’)” somerepo/image:tag. This works I know because when I bash into […]

Nginx on docker – daemonize and attach to bash [closed]

I want to host nginx on a docker container. I’ve realized that in order to stop the container from exiting instantly i have to configure nginx to ‘daemon off’. However, now I’ve done this it seems I can’t attach to the container to run bash commands. How can I attach to my running nginx container […]

Docker RUN statement (modifying a file) not executed

I am experiencing strange behavior when executing a Dockerfile (in https://github.com/Krijger/es-nagios-docker). Basically, I add a file to append its contents to a file in the image ADD es-command /tmp/ RUN cat tmp/es-command >> /opt/nagios/etc/objects/commands.cfg The problem is that, while /tmp/es-command is present in the resulting image, the commands.cfg file was not changed. As a prelude […]

Referencing a dynamic argument in the Docker Entrypoint

I want to run a docker container like this: docker run –rm -it -v volume1:/target -v volume2:/backup duplicity-image backup-label This would cause the following Entrypoint do get executed: duplicity /target file:///backup/$backup-label So my question is how do I structure the ENTRYPOINT such that it can resolve the $backup-label and how do I pass the backup-label […]

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