Posts

Showing posts with the label docker

Docker File Non-Zero Code 100 Error When Building

Docker File Non-Zero Code 100 Error When Building Here is my Docker File: FROM ubuntu:16.04 MAINTAINER Alexandre Savio <alexsavio@gmail.com> RUN ln -snf /bin/bash /bin/sh ARG DEBIAN_FRONTEND=noninteractive ENV PETPVC_VERSION v1.2.1 ENV PETPVC_GIT https://github.com/UCL/PETPVC.git ENV ITK_VERSION v4.12.2 ENV ITK_GIT http://itk.org/ITK.git ENV VTK_VERSION v6.3.0 ENV VTK_GIT https://gitlab.kitware.com/vtk/vtk.git ENV SIMPLEITK_VERSION v1.0.1 ENV SIMPLEITK_GIT http://itk.org/SimpleITK.git ENV ANTS_VERSION v2.2.0 ENV ANTS_GIT https://github.com/stnava/ANTs.gi ENV NEURODEBIAN_URL http://neuro.debian.net/lists/xenial.de-m.full ENV NEURODEBIAN_PGP hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9 ENV LIBXP_URL http://mirrors.kernel.org/ubuntu/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb ENV AFNI_URL https://afni.nimh.nih.gov/pub/dist/bin/linux_fedora_21_64/@update.afni.binaries ENV CAMINO_GIT git://git.code.sf.net/p/camino/code ENV SPM12_URL http://www.fil.ion.ucl.ac.uk/spm/download/...

nodejs same version number in all the dependencies

nodejs same version number in all the dependencies During docker vulnerability check we found that package minimatch has vulnerabilities. Due to this we have to use minimatch package to latest which is 3.0.4. I have copied the package-lock.json in the js section of fiddler https://jsfiddle.net/Loecjuy4/1/ "minimatch": "3.0.4" instead of "minimatch": "2.0.10" If you search the package-lock.json at fiddler link that I provided, you will find minimatch as dependencies in many places sometimes version 3.0.4 is used (line 2022 in eslint) while in other places version 2.0.10 is used (line 3170). I want to know a way such that package minimatch has the same version 3.0.4 in all the places of package-lock.json. I have tried shrinkwrap but it too shows different version of minimatch. You tagged your question with [docker] tag, could you please indicate the relevance? Also where did you get your package-lock.json from? ...

Raspberry Pi GPIO in Docker container (Homebridge)

Raspberry Pi GPIO in Docker container (Homebridge) I am trying to access the GPIO pins on my Pi3 B from a docker container. The container is started using docker-compose. I already tried using privileged mode, addind /dev/gpiomem as a device and adding /sys/class/gpio as a volume. I cannot get it to work. Has anyonne accomplished this? The Error is: EACCES: permission denied, open '/sys/class/gpio/export' Can you show us specifically what you've tried, and the resulting behavior? – larsks Jun 29 at 18:15 By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Copying files from Docker container to host

Copying files from Docker container to host I'm thinking of using docker to build my dependencies on a CI server, so that I don't have to install all the runtimes and libraries on the agents themselves. To achieve this I would need to copy the build artifacts that are built inside the container back into the host. Is that possible? 12 Answers 12 In order to copy a file from a container to the host, you can use the command docker cp <containerId>:/file/path/within/container /host/path/target Here's an example: [jalal@goku scratch]$ sudo docker cp goofy_roentgen:/out_read.jpg . Here goofy_roentgen is the name I got from the following command: [jalal@goku scratch]$ sudo docker ps [sudo] password for jalal: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1b4ad9311e93 bamos/...

Install node_modules inside Docker container and synchronize them with host

Install node_modules inside Docker container and synchronize them with host I have the problem with installing node_modules inside the Docker container and synchronize them with the host. My Docker's version is 18.03.1-ce, build 9ee9f40 and Docker Compose's version is 1.21.2, build a133471 . node_modules 18.03.1-ce, build 9ee9f40 1.21.2, build a133471 My docker-compsose.yml looks like: docker-compsose.yml # Frontend Container. frontend: build: ./app/frontend volumes: - ./app/frontend:/usr/src/app - frontend-node-modules:/usr/src/app/node_modules ports: - 3000:3000 environment: NODE_ENV: ${ENV} command: npm start # Define all the external volumes. volumes: frontend-node-modules: ~ My Dockerfile : Dockerfile # Set the base image. FROM node:10 # Create and define the working directory. RUN mkdir /usr/src/app WORKDIR /usr/src/app # Install the application's dependencies. COPY package.json ./ COPY package-lock.json ./ RUN npm install The trick with...

Unable to serve Angular application through minikube (Kubenetes) on Windows

Unable to serve Angular application through minikube (Kubenetes) on Windows I am running Docker for Windows and Minikube (Kubernetes) to serve an Angular application. The angular application is served using ng serve and is working properly on windows. I created the below Dockerfile: ng serve # Use an official Nodejs runtime as a parent image FROM node:6.10.3 #Create an unprivileged user 'app' #Install dependencies RUN useradd --user-group --create-home --shell /bin/false app && npm install -g grunt-cli && npm install -g @angular/cli # Define environment variable ENV ENVIRONMENT="dev" HOME=/home/app #Copy the code to the image COPY . $HOME/frontend/ #Chmod the files to allow unprivileged user 'app' to read/write RUN chown -R app:app $HOME/* #Use unprivileged user 'app' to run the app inside the container USER app #Set Current Working Directory of the runtime WORKDIR $HOME/frontend #Install NPM dependencies RUN npm install # Make p...

Go-compiled binary won't run in an alpine docker container on Ubuntu host

Go-compiled binary won't run in an alpine docker container on Ubuntu host Given a binary, compiled with Go using GOOS=linux and GOARCH=amd64 , deployed to a docker container based on alpine:3.3 , the binary will not run if the docker engine host is Ubuntu (15.10): GOOS=linux GOARCH=amd64 docker alpine:3.3 sh: /bin/artisan: not found This same binary (compiled for the same OS and arch) will run just fine if the docker engine host is busybox (which is the base for alpine ) deployed within a VirtualBox VM on Mac OS X. busybox alpine This same binary will also run perfectly fine if the container is based on one of Ubuntu images. Any idea what this binary is missing? This is what I've done to reproduce (successful run in VirtualBox/busybox on OS X not shown): Build (building explicitly with flags even though the arch matches): ➜ artisan git:(master) ✗ GOOS=linux GOARCH=amd64 go build Check it can run on the host: ➜ artisan git:(master) ✗ ./artisan 10:14:04.925 [ERROR] artisan:...

Unable to restart php-fpm in alpine linux nginx docker image

Unable to restart php-fpm in alpine linux nginx docker image I am trying to get php to work on the official nginx alpine linux docker image nginx:alpine . At the entrypoint of the container, I am running a script that does something like: nginx:alpine rc-service -v php-fpm7 restart && nginx-debug -g "daemon off;" rc-service -v php-fpm7 restart && nginx-debug -g "daemon off;" but alpine linux keeps on showing WARNING: php-fpm7 is already starting I have also tried executing inside the container rc-service -v php-fpm7 stop and then rc-service -v php-fpm7 start , but I get pretty much the same error: rc-service -v php-fpm7 stop rc-service -v php-fpm7 start ERROR: php-fpm7 stopped by something else WARNING: php-fpm7 is already starting after doing this a random number of times, I get: /lib/rc/sh/openrc-run.sh: line 273: can't create /sys/fs/cgroup/blkio/tasks: Read-only file system /lib/rc/sh/openrc-run.sh: line 273: can't create /sys/fs/cgrou...

Set the selinux status to `Permissive`, still can not run docker

Set the selinux status to `Permissive`, still can not run docker After I install the docker, I have set the selinux status to Permissive , still can not run docker. Permissive In my /etc/selinux/config , I have edit the SELINUX=disabled . /etc/selinux/config SELINUX=disabled and setenforce 0 , check with: setenforce 0 # getenforce Permissive I use systemctl start docker , but failed, get bellow error: systemctl start docker # systemctl status docker.service ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since 五 2018-06-29 09:05:47 CST; 14s ago Docs: http://docs.docker.com Process: 21615 ExecStart=/usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current --init-path=/usr/libexec/d...

docker stack command is not in the list of docker command

docker stack command is not in the list of docker command docker stack is not in the list of docker commands. docker stack But it works fine. Is it a bug or what? Here is the command list of docker: Management Commands: config Manage Docker configs container Manage containers image Manage images network Manage networks node Manage Swarm nodes plugin Manage plugins secret Manage Docker secrets service Manage services swarm Manage Swarm system Manage Docker trust Manage trust on Docker images volume Manage volumes Commands: attach Attach local standard input, output, and error streams to a running container build Build an image from a Dockerfile commit Create a new image from a container's changes cp Copy files/folders between a container and the local filesystem create Create a new container diff Inspect changes to files or directories on a container...

Naming pattern for “Path” in docker.json

Naming pattern for “Path” in docker.json I am new to docker and im working on a project that is was written by someone else so Project is multimodular and parent module is called BIH then i have a module account-microservice. In my docker.json i have such { "type": "http", "config": { "host": "config-server", "port": 80, "path": "/bih-user-account-microservice/docker.json" }, "scanPeriod": 5000 } I dont understand the path name "bih-user-account-microservice" is this a random name, because if it was a path it should be bih/account-microservice/docker.json. My question is can some tell me if Path name can be given some random name ? By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of...

How to start specific spring batch job with command line

How to start specific spring batch job with command line I have two configured jobs in my spring boot application. I want to trigger a job manually, using a command in my docker-compose.yml to trigger it. To accomplish this first I disable the batch.job.enabled property in my application.yml: batch: initialize-schema: always job: enabled: false I disable it in order to not allow Spring to execute my jobs on application startup. I'm trying to test my jobs with docker, so in my docker-compose.yml I set this command on my application service to execute when my container is up: command: java -jar batch-application-1.0-SNAPSHOT.jar -Dspring.batch.job.names=uploadToS3Job date=2018-06-26 type=MyType This command runs the uploadToS3Job with job parameters date and type. uploadToS3Job When I run my application with docker-compose up --build , spring application runs smoothly but the job is not executed, nothing happens, no crash, no nothing. docker-compose up --build But if I s...

ENTRYPOINT and CMD with build arguments

ENTRYPOINT and CMD with build arguments This doesn't work: FROM alpine:3.7 # build argument with default value ARG PING_HOST=localhost # environment variable with same value ENV PING_HOST=${PING_HOST} # act as executable ENTRYPOINT ["/bin/ping"] # default command CMD ["${PING_HOST}"] It should be possible to build an image with build-arg and to start a container with an environment variable to override cmd as well. docker build -t ping-image . docker run -it --rm ping-image Error: ping: bad address '${PING_HOST}' UPDATE: FROM alpine:3.7 # build argument with default value ARG PING_HOST=localhost # environment variable with same value ENV PING_HOST ${PING_HOST} COPY ./entrypoint.sh /usr/local/bin/ # act as executable ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] # default command CMD $PING_HOST entrypoint.sh #!/bin/sh /bin/ping $PING_HOST This works because the entrypoint.sh enables variable substitution as expected. Wh...