Questions tagged bash

Explore the latest questions and answers asked by our top developers.

Run local script with arguments with docker

I am trying to run a local script with docker bash in windows PowerShell but not working. My script part is another program, but the finally goal is to process a media file and zip it with the shell script. The cmd: docker exec -it containername /bin/bash < myscript.sh -f fileone.mp4 -h output I have […]

By nszmmp
Published
Categorised as bash, docker, powershell Tagged , ,

Grep does not show color even when using –color=always

Grep usually shows highlighted text in red which is what I wanted but this time it doesn’t seem to do that no matter what I do. I am doing this from a Docker container (nginx:1.19-alpine more specifically) and I installed Bash 5.1 using RUN apk add bash. Then I added a ~/.bashrc config file with […]

By martins16321
Published
Categorised as bash, docker, grep, linux, shell Tagged , , , ,

Composer post-install scripts not executed during docker container build

I am trying to build a docker image with a PHP application in it. This application installs some dependencies via composer.json and, after composer install, needs some customizations done (eg some files must be copied from vendor folder into other locations and so on). So I have written these steps as bash commands and putted […]

By Nik
Published
Categorised as bash, composer-php, docker Tagged , ,

How do I add Docker bash completion?

I am trying to add Docker bash completion on mac 11.5.2. I followed the steps for mac, Docker-compose completion. After the ‘brew install bash-completion’ step, brew returned the path and said to add this to my .bash_profile: [[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh" Whereas, the Docker docs said to add this: if [ -f […]

By Kevin T
Published
Categorised as bash, docker, macos Tagged , ,

sh: : unknown operand when running shell script via docker [duplicate]

#!/bin/sh while : do if [[ $(find . -type f -name "*.zip") ]]; then calling_other_function else break fi done When I run these lines of code using bash terminal it works as it should. But when I run this file via docker, I get this error: sh: : unknown operand Here I trying to check […]

By tapas kumar
Published
Categorised as alpine-package-keeper, bash, docker, sh, shell Tagged , , , ,

Trap docker signal and stop procces

I have already read and try this https://www.ctl.io/developers/blog/post/gracefully-stopping-docker-containers/ Gracefully Stopping Docker Containers https://docs.docker.com/engine/reference/commandline/stop/ https://www.linuxjournal.com/content/bash-trap-command And added a SIGTERM to my Dockerfile Even more, I don’t remember I’m not able to gracefully stop my docker container, the container just stop and kill everything inside instead of run my trap handler, I have been trying to solve […]

By Vinanrra
Published
Categorised as bash, docker Tagged ,

Migrations doesn’t starts for dockerized Django project

I’ve created e simple hello world project with Django and Docker. At the end of Dockerfile there is the command below: ENTRYPOINT ["/app/web/entrypoint.sh"] that activate this script: #!/bin/sh echo " —> DB Connection Parameters: DB name: $DB_NAME DB host: $DB_HOST DB port: $DB_PORT" poetry run python3 website/manage.py migrate –noinput poetry run python3 website/manage.py collectstatic –noinput […]

By Massimiliano Moraca
Published
Categorised as bash, django, docker Tagged , ,

OCI runtime create failed: container_linux.go:380

I am trying to start a container from the given image below but I am getting the following error: ERROR: for code_challenge_api Cannot start service api: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/app/entrypoint.sh": permission denied: unknown ERROR: for api Cannot start service api: OCI runtime create failed: container_linux.go:380: starting container process […]

By dsha256
Published
Categorised as bash, docker, docker-compose, runtime, ubuntu Tagged , , , ,

Cannot import PyTorch in Alpine Docker Container

The MRE below should be enough to explain what I’m trying to do. Google doesn’t help as it seems to be a unique error, which surprised me since Alpine & PyTorch are both fairly popular. Dockerfile: FROM nginx:stable-alpine as production WORKDIR /app RUN apk update && apk add –no-cache python3 bash && python3 -m ensurepip […]

By Polzarak
Published
Categorised as alpine, bash, docker, python, pytorch Tagged , , , ,

Docker Station Iptables Command

I have a virtual machine running on VBox. This VM contains the host and three dockers, let`s name the dockers as the_first, the_second, the_third. I want to apply a filter on network firewall with iptables that can do this: Running through the host and set this from terminal: To block all connections that are going […]

By error404
Published
Categorised as bash, bin, docker, iptables, linux Tagged , , , ,
1 67

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq