Tag: bash

Customize docker container bash

I try to set a custom configuration for Docker container bash prompt to display the git branch name when connected. I found everything to make it properly, but I fail to execute the ~/.profile or even ~/.bash_profile files at container’s building. If I perform source ~/.profile manually inside the container, it works fine. But I […]

Collecting output from Docker in java application

I’m executing some code on docker in my java application using ProcessBuilder to run the code, however i’m having trouble retrieving the output from it. BufferedReader is not reading anything from the InputStream returned from the container. Is there a specific way to retrieve output from Docker?? I’ve never had trouble getting output from bash […]

Bash not executed after the user logging

I’m trying to execute a script after the user is logged in but it’s not working. I have created a script which is executing a docker with the command “docker exec” and a shell bash. After this, some commands are executed into the shell to launch a specific application. I have put this script into […]

Docker container cannot clone public Github repo

I am guessing this is an internet connectivity issue, however, there might be some RSA public key missing. I have this Dockerfile: FROM node:4-onbuild COPY test-install-post-publish.sh /usr/src/app/ EXPOSE 8888 The bash script that gets COPY’ed into the container looks like: #!/usr/bin/env bash cd # cd to home dir mkdir suman-test cd suman-test && rm -rf […]

Calling Git in Jenkins build script in Docker

I have a build script for a Jekyll website (GH pages) that required calling git commands that require Github authentication from inside of the script. Here is the script: #!/usr/bin/env bash rm -rf _site/ git clone git@github.com:RIT-EVT/RIT-EVT.github.io.git –branch master –depth 1 _site LIVE_VERSION_BUILD=`cat _site/version` LIVE_VERSION=${LIVE_VERSION_BUILD%.*} LIVE_BUILD=${LIVE_VERSION_BUILD##*.} PACKAGE_VERSION=`sed -nE ‘s/^\s*”version”: “(.*?)”,$/\1/p’ package.json` if [[ “$LIVE_VERSION” == […]

Testing ASP.NET Core Docker Container with Travis CI

So I’ve configured my .travis.yml to build and test my ASP.NET Core project, but now I’ve to configure it to run in docker. So far so good, I’ve the Dockerfile for the build, but then I started to figure: Should I run the testing inside the Docker Container or outside? Or Does it even matter? […]

docker cannot specify container connection

docker configureļ¼š root@ubuntu> ps -ef | grep docker root xxxxx /usr/bin/dockerd -H fd:// -b=br0 –icc=false –iptables=true start ‘web’ container: docker run -d –name web -p 8080:80 php-fpm:5.4 start ‘test’ container: docker run -dit –name test –link web:web blackhole/ubuntu:0.1 bash iptables filter: root@ubuntu> sudo iptables -L -n Chain INPUT (policy ACCEPT) target prot opt source destination […]

How to use docker run with a Meteor image?

I have 2 containers mgmt-app who is a Meteor container and mgmt-mongo who is the MongoDB. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7b65be4ac454 gitlab-lab:5005/dfc/mongo:latest “/entrypoint.sh mongo” About an hour ago Up About an hour 27017/tcp mgmt-mongo dff0b3c69c5f gitlab-lab:5005/dfc/mgmt-docker-gui:lab “/bin/sh -c ‘sh $METE” About an hour ago Up 42 minutes>80/tcp mgmt-app From my […]

Adding newuser in docker container with sudo privileges

Im trying to build a docker file and one of the reqt is to create a user with sudo permissions. Here is the bash script # quietly add a user without password adduser –quiet –disabled-password –shell /bin/bash –home /home/newuser –gecos “testuser” newuser # set password echo “testuser:testuser” | sudo chpasswd and the docker compose file. […]

get docker images command's output with bash script

I’m trying to get the docker images command output to display it on a webpage. Ex: Docker images ouput As you can see on the image, this is well formatted. But what I get on my web page is one line not formatted at all; REPOSITORY TAG IMAGE ID CREATED SIZE nginx latest 3448f27c273f 2 […]

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