Tag: bash

File is not created in Docker

I am new to Docker and trying to build Docker image. I simply created Docker file but getting some error not able to identify how to resolve this. My Docker file code is: FROM ubuntu MAINTAINER ravat RUN echo “Hello Apache server on Ubuntu Docker” > /home/ravata/Desktop/DockerDemo/index.html CMD [ “/bin/bash” ] the error I am […]

How to git install instead of pip install?

In this git repo for an Askbot Docker container, he installs Askbot using pip in the requirements.txt file. In the deploy/run.sh can I see that he uses uwsgi, but I can’t see anywhere how it knows the location of the pip installed Askbot app. Question Instead of having Askbot installed by pip how can I […]

Docker Error: container id followed by “command not found”

I’m having difficulty with a script I’m writing. The script is largely incomplete, but so far I expect it to be able to run containers successfully. When I execute the script I’m given an error with a container ID and “command not found”. For example: ./wordpress: line 73: 3c0fba4984f3b70f0eb3f1c15a7b157f4862b9b243657a3d2f7141029fb6641a: command not found The script I’m […]

Docker osx mounted folder is empty

I tried to mount folder of my project from /var/www to the same folder in container but folder in container is empty. Problem is maybe with host folder permissions because if i try that with some other folder it works. This works: docker run -it -v ~/Downloads:/var/www debian:jessie /bin/bash This doesn’t work: docker run -it […]

use docker exec in bash script

I have a bash script that is supposed to execute other bash scripts using “docker exec” which are installed in different docker containers. Although each command works correctly when started manually, the script stops after the execution of first docker exec command. Example: #!/bin/bash … docker exec -it mysql_container /scripts/import_database.sh ## Scripts stops here… docker […]

$(pwd) – one level up

I’m pretty new to the bash/shell script world, I’m trying to do the below and it could be pretty simple but I wasn’t able to figure out the command, would be great if someone could help me out here and also point me to some documentation wrt to shell script topics. Thank you in advance. […]

Echo printing variables in a completely wrong order

I am trying to create a string with a query that will be save / send to another location, this string contains different variables. The issue that I am having is that the echo of the variables are completely upside down and mix. See code below: tokenID=$(docker exec -ti $dockerContainerID /bin/sh -c “cat /tempdir/tokenfile.txt”) serverName=”asdasd” […]

Setting environment variables when running docker in detached mode

If I include the following line in /root/.bashrc: export $A = “AAA” then when I run the docker container in interactive mode (docker run -i), the $A variable keeps its value. However if I run the container in detached mode I cannot access the variable. Even if I run the container explicitly sourcing the .bashrc […]

How to close and reopen docker terminal

I am installing nvm inside docker. After I’ve finished installing it says to run echo “. ~/.nvm/nvm.sh” >> ~/.bash_profile and then close and reopen terminal. I think the above procedure updates bash profile and let me access nvm.sh from bash with nvm command. But, to do this, I have to close and reopen bash/terminal. Is […]

How to answer command line prompts in script in docker

I’m running a Dockerfile which looks like this: FROM alexhermstad/arch-pypi2pkgbuild-kolibri MAINTAINER Alex Hermstad USER kol WORKDIR /home/kol/pypi2pkgbuild CMD [“python”, “./pypi2pkgbuild.py”, “–pre”, “kolibri”] Within pypi2pkgbuild.py, there’s a prompt that comes up, which says: :: Proceed with installation? [Y/n] Is there anyway that I can use docker to automatically press ‘n’ to skip the installation? I searched […]

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