Tag: bash

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

How to run Python server on Docker's container

I want to run Python HTTP server on docker container. My DockerFile looks like this: FROM continuumio/anaconda3:latest RUN apt-get -y update RUN apt-get -y install linux-headers-amd64 build-essential libc-dev gcc RUN conda install –yes gcc RUN conda install –yes numpy RUN conda install –yes scipy RUN conda install –yes gensim RUN pip install annoy RUN conda […]

Use Docker to compile and run untrusted code in Django App [closed]

I am building a Django web application to compile and run untrusted code in different languages submitted by user. The steps behind compilation are : Take the code from editor provided on run action store in database with a file name run it using bash script. Since there are problems of security, of directly running […]

Docker Jenkins slave wrong character encoding

I’m using this Jenkins slave docker image, it is based on ubuntu:14.04 I would like to use a String Parameter which contains UTF-8 characters. The charachers like öüóőúűáéí (Hungarian characters) will be replaced to question marks As this ticket mentions I tried to pass -e LANG=hu_HU.UTF-8 and bash -c “locale-gen hu_HU.UTF-8” to docker. I also […]

How to get true or false as a response from docker if the service is running or not

I want to check the docker service is running or not; I am expecting true or false as a response: docker service ps data-mapper-service docker service ps -f “node=vm-jcibe-microservice-qa-app01” data-mapper-service These are the command I tried which giving me. It gives me the info on that service if it present. if I do docker service […]

Unable to modify file as part of entry point command

My Dockerfile‘s entry point CMD executes a shell script to modify a local file based on an environment variable before executing my application (Flask). The shell script is like so: cat static/login.html | sed “s/some_match/some_substitute/g” > static/login.html However, I am finding that the resulting file is zero bytes. Any ideas what might be doing on? […]

passing arguments to docker exec from bash prompt and script

I am trying to execute a command inside my mongodb docker container. From my linux command prompt it is pretty easy and works when I do this docker exec -it d886e775dfad mongo –eval ‘rs.isMaster()’ The above tells me to go to a container and execute the command “mongo –eval ‘rs.isMaster()’ – This tells mongo to […]

Issue when I try to create a docker image [duplicate]

This question already has an answer here: Why docker container exits immediately 5 answers

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