Tag: bash

pipelines fail with custom docker image

I have a custom docker image on docker hub: salmantariq/node_mysql. It has MySQL server installed on it and node via nvm. I get the following error. I am sure I am missing something here but don’t know what. { bash: cannot set terminal process group (9): Not a ttybash: no job control in this shell+ […]

How to sort by name `docker service ls`

I’m using Docker Swarm 1.13.1 and it would be very practical to list services by name (A-Z). I don’t think Docker support this feat by natively so I expect some awk, sort and other little hacks. So far this is the closest I can get: root@N01-par1-dev-e:~/deploy-setup# docker service ls | sort -k2,2 -k1 yru8n6zxmp08 consul […]

Bidirectional communication with 'docker exec -it bash <container_id>' using docker-py

I can’t seem to figure out how to enable async i/o with a container shell session using docker-py SDK. What I am essentially trying to achieve is to have a working equivalent of docker exec -it bash $container_id in docker-py. Obviously, stdout poses no problems. It’s just that there is no (glaringly obvious) way to […]

Difference between sh and bash

When writing shell programs, we often use /bin/sh and /bin/bash. I usually use bash, but I don’t know what’s the difference between them. What’s main difference between bash and sh? What do we need to be aware of when programming in bash and sh?

Install Docker auto completion without using Home Brew

I want to enable the Docker auto completion. The instruction here are using brew but I’m using MacPorts. Trying to install bash-completion using $ sudo port install bash-completion seems to install a new bash on my system and I’m reluctant to do so. What is the best practice to enable auto completion for Docker using […]

Docker same image but workings in different way

I need to create a deployment system with Bitbucket’s Pipelines for my symfony project. If you want to use Pipeline you need to use a docker image. I have configure my pipeline in this way: image: laraedit/laraedit pipelines: branches: testing: – step: script: – rm -rf var/cache/ – composer install – mkdir -p ~/.ssh – […]

Good approach to depend by external files (dropbox) on a public repository?

I have a Docker repository with a project. The structure of the project looks like this: I know that if I try to ADD ../../../helpers/functions.sh in /development/php7.1.2-mongodb/app/Dockerfile would throw the error Forbidden path outside the build context, and I don’t want to have the functions.sh file in each folder. So my solution was: ADD https://www.dropbox.com/s/c913p83c11unl8x/functions.sh?dl=1 […]

process exit code 127 while running a bash script by java service in docker

I am running this script from java code in docker and exit code of the process is 127. process = Runtime.getRuntime().exec(commands); // commands is an array with script name and other variables defined in the script. process.waitFor(); openssl enc -d -aes-256-cbc -in $ENCRYPTED_TARBALL -out $OUTPUT_TAR -K $password I made sure that openssl is installed in […]

Install bash on Alpine/Docker using qemu for ARM host

I am trying to create, at buildtime on an x86 host, a docker container , for runtime on an ARM host. To do this you need to use qemu for cross compilation. I also want to use alpine linux since the image size is so small. However I am encountering an unusual error that only […]

How to check whether a docker service is already running on UCP using shell script

I want to check whether a docker service is running or not. if it’s running I want to remove that service and create the new one I am doing this task with shell script I am providing the code snippet of my shell script where I am facing Error response from daemon: service data-mapper-service not […]

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