Tag: docker

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

Errors building two different projects with stack on the same machine

We have multiple haskell projects we build with stack. Our CI process creates instances on amazon to run tests and perform builds. We occasionally get strange errors. I suspect we get them when we try to run multiple builds on the same instance. It’s my understanding that stack should be able to handle this use […]

docker: what is the similar url in docker as compared to XAMMP/MAMP

I am using docker for the codeigniter project development. Initially, when I used MAMP or XAMMP, the login page was localhost/xyz/admin/login as the server used to run on localhost (php server). But, the docker server is running on localhost:8000 and I am trying to open localhost:8000/xyz/admin/login but it shows an error that page you requested […]

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