Tag: bash

command not found when running in docker bash script

I have a docker-compose file that executes a bash script on entry. This bash script removes a few files, and then attempts to printenv which returns the error printenv: not found Now if I run the docker container in interactive mode and execute the printenv it works fine. Running docker in interactive mode docker run […]

Docker .Net Core app on Ubuntu not opening in localhost:8000

I am working on Ubuntu 16.04 and I have a docker app with .Net Core on Windows and am trying to get it to run on Ubuntu. I have docker and .Net Core running without error. When I run “sudo docker-compose up” it runs the server and is listening on “http://+:80.” But I can’t open […]

Execute multiple commands from shell to docker container

I am trying to do in one command, do a bash from docker container, open mongo and make a request with something like ‘db.test.find({});’ I am reading from others similar post without success. This is the command that I am executing. docker exec -it mongoDB bash -c ‘mongo ; use test; db.test.find({})’ And that command […]

Change ENTRYPOINT to container after building

I have a Dockerfile, which ends with: ENTRYPOINT [“/bin/bash”, “/usr/local/cdt-tests/run-tests.sh”] After building this container, I want to run it, but instead of executing this bash script (run-tests.sh), I want to open up a terminal window inside the container to inspect the filesystem. If there were no ENTRYPOINT line, I could do this: docker build -t […]

bash syntax error while running docker command

I was getting an error while running the docker ps command which is – > An error occurred trying to connect: Get > http://localhost:2375/v1.21/containers/json?all=1: dial tcp > 127.0.0.1:2375: ConnectEx tcp: No connection could be made because the target machine actively refused it. I was trying to correct the error using the instruction present in this […]

How to run “docker-compose up” command in .sh file?

I am trying to run Docker container every day using a cron job. * * * * * /Desktop/cron1.sh This is my cron1.sh file: #!/bin/sh mkdir /home/tomato/bizzz #working cd bizzz #not working docker-compose up #not working

execute docker commands from bash file

How can one run docker commands from a bash (sh) script? I am trying to run: #!/bin/bash container= $(docker ps –format “{{.ID}} {{.Names}}” -a | grep testServer | awk ‘/’$imid’/ { print $1 }’); echo $container but I get a blank for the container. TIA

How to make docker fail or check version exists

I have maven running a bash to build something with Docker. <plugin> … <artifactId>maven-antrun-plugin</artifactId> … <exec executable=”${basedir}/generate.sh” failonerror=”true”> <arg value=”${thrift.version}” /> … The bash script runs something like: for file in src/main/thrift/*.thrift; do echo “Compiling ${file}” docker run {…} thrift:${THRIFT_VERSION} thrift {…} done My problem is, when Docker can’t find the version I’m requesting, it […]

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?.

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