Tag: bash

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 […]

How to capture the output of multiple commands run in docker separately?

I use docker to run a bash file which has multiple commands in it. One per line. Is there a way to capture the output of those commands separately? I want to have something like this command has this output, this other command has this other output and so on. Or run separate commands in […]

docker-compose not picking updated code

Iam new to docker-compose trying to run a sample script in a container. Below is my Dockerfile. #Dockerfile FROM debian ADD . /scripts CMD [“bash”, “/scripts/count.sh”] #docker-compose.yml version: ‘2’ services: count: build: . volumes: – .:/scripts Sample bash script which runs in the container #!/bin/bash count=0 #while [[ $count -le 30 ]]; while : do […]

How to edit a .py script inside Docker Quickstart Terminal?

I am using docker for windows 10, and I’m using the bash command to access the files in a container. I localized the file I was searching for and I need to change a line in the code but I don’t know how to access that script to edit it. “cat” and “less” commands are […]

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