Creating an environmental variable within Docker container when starting up

How would I get the ip address of a mongo container and set it as environmental variable when creating a node image? I’ve been running into an issue with conflicting tech stacks: keystone.js, forever, and docker. My problem is that I need to set up an environmental variable for a separate mongo container which would […]

AWS BeansTalk expose docker port

I am trying to deploy an instance of Docker Gogs image to AWS. The environment and application starts fine, but the only visible port is 80, while I have “EXPOSE 3000” in my Docker file. I added the following to my git repo and deployed to AWS, but the port is still not visible. […]

Docker number of lines in terminal changing inside docker

I would like to know how to change the following behavior. Let’s say my terminal has 28 lines. Then I use the following commands: $ tput lines # my terminal 28 $ docker run –rm -it ubuntu:16.04 tput lines # docker container 24 ## WHY?? $ docker run –rm -it ubuntu:16.04 bash # docker container […]

How to run bundle install with a Dockerfile file

I want to use docker to deploy a rails application. I followed the official tutorial to do: But it seems I am not lucky. My Dockerfile FROM ruby:2.2.2 RUN apt-get update -qq && apt-get install -y build-essential # for mysql RUN apt-get install -y mysql-client libmysqlclient-dev # for a JS runtime RUN apt-get install […]

connecting to local mongodb from docker container

I have a local mongoDB server running on mongodb:// My DB name is localv2. I have a node/express app with the Dockerfile as follows: FROM node:7.5 RUN npm install -g pm2 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY package.json /usr/src/app RUN npm install COPY . /usr/src/app EXPOSE 3002 ENV NODE_ENV local CMD pm2 start –no-daemon […]

Extend docker postgres image to create extra database

I’ve already seen this topic : But I have the following problem : postgres_1 | FATAL: role “docker” does not exist app_1 | Error: Could not establish a connection with the database This is my docker-compose.yml file version: “2” services: app: build: context: . dockerfile: Dockerfiles/app.dockerfile links: – postgres depends_on: – postgres ports: – […]

How to use env attribute of Vagrant Docker provider?

I want to change an environment-variable of a docker container with the Vagrant Docker provisioner. How can I do this? Example Vagrantfile: config.vm.define ‘container’ do |ws| ws.vm.hostname = ‘container’ ws.ssh.port = 23 ws.ssh.guest_port = 23 ws.vm.provider “docker” do |d| d.image = “name/image” d.env = { “SSH_PORT” => 23 } d.vagrant_machine = “host” d.vagrant_vagrantfile = “../Vagrantfile” […]

What are the pros and cons of docker data volumes

I am looking at Managing Data in Containers. There are two ways to manage data in Docker. Data Volumes, and Data Volume Containers My question is: What are the pros and cons of these two methods? Thanks!

Run command as –privileged in Dockerfile

I need to bee –privileged to run a specific command in the Dockerfile but I can’t find a way to tell docker to do so. The command is RUN echo core > /proc/sys/kernel/core_pattern If I put that in the Dockerfile the build process fails. If I run the Dockerfile with that line commented but with […]

Docker : Can a container A call an executable located on an other container B?

I have two Docker images, one containing pandoc (an utility to convert documents in different formats to many formats), and an other containing pdflatex (from texlive, to convert tex files into pdf). My goal here is to convert documents from md to pdf. I can run each image separately : # call pandoc inside my-pandoc-image […]

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