Tag: dockerfile

Installing Jenkins Plugins to Docker Jenkins

I have the following Dockerfile with jenkins as the base image: FROM jenkins USER root ENV JENKINS_MIRROR http://mirrors.jenkins-ci.org RUN for plugin in git-client git ws-cleanup ; do wget -O $JENKINS_HOME/plugins/${plugin}.hpi $JENKINS_MIRROR/plugins/${plugin}/latest/${plugin}.hpi ; done EXPOSE 8080 I’m trying to install some additional plugins but it gives me an error saying no such file or directory I […]

How to reduce my java/gradle docker image size?

I have a Docker file like the following: FROM openjdk:8 ADD . /usr/share/app-name-tmp WORKDIR /usr/share/app-name-tmp RUN ./gradlew build \ mv ./build/libs/app-name*.jar /usr/share/app-name/app-name.jar WORKDIR /usr/share/app-name RUN rm -rf /usr/share/app-name-tmp EXPOSE 8080 RUN chmod +x ./docker-entry.sh ENTRYPOINT [ “./docker-entry.sh” ] The problem is that the final image size is 1.1GB, I know it happens because gradle downloads […]

docker inside docker container

I want to install docker inside a running docker container. docker run -it centos:centos7 My base container is using centos, I can login to running container using docker exec. But when I try to install docker inside it using yum install -y docker it installs. But somehow I can’t start the docker service with docker […]

Can Docker help build executable that work in different platform

I am new to docker and so my question could be very naive/stupid. The application that we use presently need to be compiled in different platform to make it work in desired platform i.e Linux and Window mainly. So we need to compile source code(C/C++) in different platform and give different executable to customer as […]

Docker image error: “/bin/sh: 1: [python,: not found”

I’m building a new Docker image based on the standard Ubuntu 14.04 image. Here’s my Dockerfile: FROM ubuntu:14.04 RUN apt-get update -y RUN apt-get install -y nginx git python-setuptools python-dev RUN easy_install pip ADD . /code WORKDIR /code RUN pip install -r requirements.txt # only ‘django’ for now ENV projectname myproject EXPOSE 80 8000 WORKDIR […]

Building Dockerfile fails when touching a file after a mkdir

I’m new to Docker and try to build an image with a simple Dockerfile: FROM jenkins USER root RUN mkdir -pv /home/a/b RUN touch /home/a/b/test.txt RUN mkdir -pv /var/jenkins_home/a/b RUN touch /var/jenkins_home/a/b/test.txt USER jenkins When I build it, it fails with the following output: Step 0 : FROM jenkins Step 1 : USER root Step […]

Docker – no such file or directory

I’m receiving an error from docker when I run my docker file. It’s saying the /var/lib/docker/aufs/layers/xxxx: no such file or directory when I run Docker build . I have tried numerous ways to remove containers and images so I’m pretty much stock on this one. Any The Docker file is: FROM node:6 RUN git clone […]

How to install a local rpm file when building docker instance?

I have following docker file, I want to specifically install a rpm file that is available on my disk as I am building docker instance. My invocation of rpm install looks like this. Command RUN rpm -i chrpath-0.13-14.el7.x86_64.rpm fails. Is there a way to install rpm file available locally to new Docker instance? FROM centos:latest […]

Dockerfile: understanding VOLUME instruction

Let’s take an example. The following is the VOLUME instruction for the nginx image: VOLUME [“/etc/nginx/sites-enabled”, “/etc/nginx/certs”, “/etc/nginx/conf.d”, “/var/log/nginx”, “/var/www/html”] Here are my questions: When you start the container, will these directories show up on my host? And when I stop my container, the directories will stay? If some (or all) of these directories already […]

Editing files from dockerfile

I need to add several lines to /etc/sysctl.conf in a docker image. Is there an idempotent way to do this via a dockerfile rather than editing manually and using the docker commit approach?

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