Category: Docker

Docker Technology Fans

Docker proper redirect link

I have Dockerfile: FROM cloudron/base:0.10.0 ENV PATH /usr/local/node-6.9.5/bin:$PATH WORKDIR /tmp COPY package.json /tmp/ RUN npm config set registry http://registry.npmjs.org/ && npm install WORKDIR /usr/src/app COPY . /usr/src/app RUN cp -a /tmp/node_modules /usr/src/app RUN npm run build EXPOSE 8000 CMD [ “npm”, “run”, “start:production” ] if I run this by: docker run -p 8000:8000 -t somename/appname […]

How to compile apache2 own module in dockerfile?

I want to compile my own Apache module when building my image, so i wrote the following Dockerfile. FROM httpd:2.4.25 COPY conf/httpd.conf /usr/local/apache2/conf/httpd.conf COPY modules/mod_example.c /usr/local/apache2/modules/mod_example.c RUN apxs -i -a -c modules/mod_example.c EXPOSE 80 But i get an error : /usr/share/apr-1.0/build/libtool –silent –mode=compile x86_64-linux-gnu-gcc -std=gnu99 -prefer-pic -DLINUX -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/local/apache2/include -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -c […]

How to wait a ResultCallback from DockerClient.waitContainerCmd()?

In our J2EE project, we’re doing some video conversion by calling sjourdan/ffmpeg docker from our java code, relying on docker-java. For now, it looks something like this (quite simplified for brevity): CreateContainerCmd createCommand = dockerClient.createContainerCmd(“sjourdan/ffmpeg”) .withVolumes(aVolume) .withBinds(aBind) .withCmd(“a lot of options about the conversion itself, codec, ratio, …”); CreateContainerResponse container = createCommand.exec(); dockerClient.startContainerCmd(container.getId()).exec(); // vanilla […]

Deploying Docker Data Volumes

How do I deploy a named data volume, with contents, to nodes in a swarm? Here is what I want to do, as described in the Docker documentation: “Consider a situation where your image starts a lightweight web server. You could use that image as a base image, copy in your website’s HTML files, and […]

Docker pull is not giving real time downloaded-size/total-size when executed through Node.js child process sync

When I run docker pull my-image from my terminal this is how my output looks like. 59e69571f6c7: Pull complete 43da27f69c98: Pull complete d22174e9eddd: Pull complete cc0ac48a6d21: Downloading 312.3 MB/2.888 GB b47aa969d5dc: Download complete When I run a piece of Node.js code const { exec } = require(‘child_process’); exec(‘docker pull my-image’, (error, stdout, stderr) => { […]

Cant mount volume docker run

Can’t mount volumes with below script docker run –server -p 8080:80 -v /d/XAMPP/htdocs:/var/www/html -d php:7.0-apache When I try docker run –server -p 8080:80 -v /d:/var/www/html -d php:7.0-apache With this command only XAMPP folder is mounting in docker and I don’t see any folders inside, and I have 403 when I try to access root folder […]

Running a script from a mongodb docker-container

I have script that restores the database restore.sh: mongorestore –port 27017 –db myapp `pwd`/db-dump/myapp I want to run this in a short lived docker-container using the image mvertes/alpine-mongo. To run a shortlived container the –rmis used: docker run –rm –name mongo -p 27017:27017 \ -v /data/db:/data/db \ mvertes/alpine-mongo But how do I execute my script […]

Artifactory: “docker service create” does not work with images of 0 byte

docker service create … works even though compressed image size is 0B in Docker Hub. On the other hand, when I use Artifactory as private registry, it fails with No such image error. Docker daemons’ debug logs say manifest verification failed for digest … As an example, compressed size of portainer’s latest tag and main […]

Docker – nginx with custom conf

When running docker-compose up with the following docker-compose.yml file, nginx immediately exits after starting. When I remove the following line: – ./nginx/config:/etc/nginx/conf.d nginx does not immediately exit. docker-compose.yml version: ‘3’ services: nginx: image: nginx ports: – ‘8080:80’ volumes: – ./nginx/log:/var/log/nginx – ./nginx/config:/etc/nginx/conf.d – ../wordpress:/var/www/wordpress php: image: php:fpm ports: – 9000:9000 mysql: image: mysql ports: – […]

Vagrant: use provider and provision togather

This my main Vagrant file Vagrant.configure(2) do |config| config.vm.define “app7” do |app7| app7.vm.synced_folder “/home/behrad/dunro”,”/var/www/html” app7.vm.network “forwarded_port”, id: “ssh”, guest: 22, host: 2222, auto_correct: true app7.vm.provider “docker” do |docker| docker.vagrant_vagrantfile = “dev/app7/Vagrantfile” docker.build_dir = “./dev/app7” docker.build_args = “-t”,”dunro/app7:20170701″ docker.name = “app7” docker.ports = [’80:80′] docker.has_ssh = true end end end and dev/app7/Vagrantfile Vagrant.configure(2) do |config| config.vm.hostname […]

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