I’m using docker-machine to manage my cloud servers. I’m writing some bash scripts to automate some tasks. The question is: “How to check in bash script if docker machine with the specific name already exists?”. I need some expression to return true if it exists and false if it doesn’t. Thanks
For example in the redis official image: https://github.com/docker-library/redis/blob/master/2.8/docker-entrypoint.sh #!/bin/bash set -e if [ “$1” = ‘redis-server’ ]; then chown -R redis . exec gosu redis “$@” fi exec “$@” Why not just run the commands as usual without exec preceding them?
Is there any way to share a .bash_history volume with a docker container so that everytime I go into a shell I have my bash history available for scrolling through? Would be awesome to be able to do the same thing with IPython too.
I am deploying a few different docker containers, mysql being the first one. I want to run scripts as soon as database is up and proceed to building other containers. The script has been failing because it was trying to run when the entrypoint script, which sets up mysql (from this official mysql container), was […]
Trying to fix errors and debug problems with my application that is split over several containers, I frequently edit files in containers: either I am totally lazy and install nano and edit directly in container or I docker cp the file out of the container, edit it, copy it back and restart the container Those […]
I can’t figure out how to read content of a file from a Docker container. I want to execute content of a SQL file into my PGSQL container. I tried: docker exec -it app_pgsql psql –host=127.0.0.1 –username=foo foo < /usr/src/app/migrations/*.sql My application is mounted in /usr/src/app. But I got an error: bash: /usr/src/app/migrations/*.sql: No such […]
I am new to docker. I found that we can set environment variables using ENV instruction in the Dockerfile. But how does one set bash aliases for long commands in Dockerfile?
Setting up a Dockerfile to install node prereqs and then set up supervisor in order to run the final npm install command. Running Docker in CoreOS under VirtualBox. I have a Dockerfile that sets everything up correctly: FROM ubuntu MAINTAINER <<Me>> # Install docker basics RUN echo “deb http://archive.ubuntu.com/ubuntu precise main universe” > /etc/apt/sources.list RUN […]
I am creating a docker image using a Dockerfile. I would like to execute some scripts while starting the docker container. Currently I have a shell script to execute all the necessary processes CMD [“sh”,”start.sh”] I would like to execute a shell command with a process running in background example CMD [“sh”, “-c”, “mongod –dbpath […]
I’ve created a docker container using the following Dockerfile (truncated): FROM ubuntu:12.04 # curl enables downloading of other things RUN apt-get install curl -y # download and install rvm… RUN \curl -L https://get.rvm.io | bash -s stable # … so that we can install ruby RUN /bin/bash -l -c “rvm requirements” And so on. This […]