Tag: bash

How to create User/Database in script for Docker Postgres

I have been trying to set up a container for a development postgres instance by creating a custom user & database. I am using the official postgres docker image. In the documentation it instructs you to insert a bash script inside of the /docker-entrypoint-initdb.d/ folder to set up the database with any custom parameters. My […]

Docker timeout for container?

For my dissertation at University, I’m working on a coding leaderboard system where users can compile / run untrusted code through temporary docker containers. The system seems to be working well so far, but one problem I’m facing is that when code for an infinite loop is submitted, E.g: while True: print “infinite loop” the […]

Using the RUN instruction in a Dockerfile with 'source' does not work

I have a Dockerfile that I am putting together to install a vanilla python environment (into which I will be installing an app, but at a later date). FROM ubuntu:12.04 # required to build certain python libraries RUN apt-get install python-dev -y # install pip – canonical installation instructions from pip-installer.org # http://www.pip-installer.org/en/latest/installing.html ADD https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py […]

How to check if a Docker image with a specific tag exist locally?

I’d like to find out if a Docker image with a specific tag exists locally. I’m fine by using a bash script if the Docker client cannot do this natively. Just to provide some hints for a potential bash script the result of running the docker images command returns the following: REPOSITORY TAG IMAGE ID […]

Running a script inside a docker container using shell script

I am new to Docker technology,I am trying to create a shell script for setting up a docker container, my script file looks like following #!bin/bash docker run -t -i -p 5902:5902 –name “mycontainer” –privileged myImage:new /bin/bash Running this script file will run the container in a newly invoked bash. Now i need to run […]

How to pass arguments to Shell Script through docker run

I am new to the docker world. I have to invoke a shell script that takes command line arguments through a docker container. Ex: My shell script looks like: #!bin/bash echo $1 Dockerfile looks like this: FROM ubuntu:14.04 COPY ./file.sh / CMD /bin/bash file.sh I am not sure how to pass the arguments while running […]

Bash Script to execute Docker container operations and extract container IP Address

I am trying to write a Linux bash script that creates and runs docker containers that run a simple python web server, extract the container IP Address and make an HTTP Request to the server through a browser. There seem to be some mistakes in my script and I need help in editing it. I […]

Unable to install docker

I am trying to do hyperledger fabric(setting up the environment) and it required docker. I tried searching the internet of solving to install docker but it was to no avail. The following is the errors encountered when I tried to install dockers. At git bash(git) I tried to use sudo apt-get install docker-engine. But it […]

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