docker-container

Riak container does not start when its data volume is mounted

拈花ヽ惹草 提交于 2019-12-13 20:27:07
问题 The following command works perfectly and the riak service starts as expected: docker run --name=riak -d -p 8087:8087 -p 8098:8098 -v $(pwd)/schemas:/etc/riak/schema basho/riak-ts The local schemas directory is mounted successfully and the sql file in it is read by riak. However if I try to mount the riak's data or log directories, the riak service does not start and timeouts after 15 seconds: docker run --name=riak -d -p 8087:8087 -p 8098:8098 -v $(pwd)/logs:/var/log/riak -v $(pwd)/schemas:

send tomcat conf files to container using kubernetes

风流意气都作罢 提交于 2019-12-13 17:27:29
问题 I am new to docker and Kubernetes, I am trying to create a container having tomcat7/Java7 so that I could deploy my webapps into it. The only concern I have are the tomcat/conf config files, which have details of database connections , threadpool , Java Memory etc. What I want is to copy these files from Kubernetes server to docker-container and place them at right places, while starting the container. P.S: I don't want to do it via enviroment variables, as they are going to be huge in

Cron in postgresql:alpine docker container

こ雲淡風輕ζ 提交于 2019-12-12 20:08:22
问题 I am using the "plain" postgresql:alpine docker image, but have to schedule a database backup daily. I think this is a pretty common task. I created a script backup and stored in the container in /etc/periodic/15min , and made it executable: bash-4.4# ls -l /etc/periodic/15min/ total 4 -rwxr-xr-x 1 root root 95 Mar 2 15:44 backup I tried executing it manually, that works fine. My problem is getting crond to run automatically. If I exec docker exec my-postgresql-container crond , the deamon is

How to scale down/up containers in aws ecs cluster by command line, should I use aws cli or ecs-cli?

心不动则不痛 提交于 2019-12-12 17:40:54
问题 I'm running AWS ECS cluster with EC2 instances and I want a command to scale up the tasks to 1 running instance and then after some time when I do not need it I want to scale it down to 0. This should destroy the underlying EC2 instance to avoid charges. I'm not using Fargate as it is not in free tier. what I'm currently using to scale up to one and start running it: ecs-cli scale --capability-iam --size 1 --cluster myEC2clusterName --region us-east-1 aws ecs run-task --cluster

Docker Connecting PHP container to MySQL

拈花ヽ惹草 提交于 2019-12-12 11:09:51
问题 I have two containers, a apache-php container, and a mysql db container. I am trying to get my php script to query my sql database. I am however receiving the following errors; Fatal error: Uncaught PDOException: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known AND Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] No such file or directory when toggling the host address, i think i am missing something fundamental to docker and this is

Is it possible to start a stopped container from another container

你说的曾经没有我的故事 提交于 2019-12-12 07:13:12
问题 There are two containers A and B. Once container A starts, one process will be executed, then the container will stop. Container B is just an web application (say expressjs). Is it possible to kickstart A from container B ? 回答1: It is possible to grant a container access to docker so that it can spawn other containers on your host. You do this by exposing the docker socket inside the container, e.g: docker run -v /var/run/docker.sock:/var/run/docker.sock --name containerB myimage ... Now, if

docker swarm create service failed when pull images from private registry

依然范特西╮ 提交于 2019-12-11 17:54:16
问题 As a docker beginner, I have built a swarm cluster on 5 Linux server. (docker version 17.12.0-ce) But when I create a service, I see docker service ps command shows "pulling image failed" error="pull access denied for registry.xxxx.xxx . I'm using a private registry which should be use docker login at first. So, how to do the login action when creating a swarm service ? 回答1: You need to pass the --with-registry-auth flag on docker service create to pass your credentials. Authenticate if you

docker container / image not saving changes

不问归期 提交于 2019-12-11 16:46:23
问题 I pulled a MySQL docker(latest) & after running it I am trying to commit my container after adding some Data & New Schema's & tables in this mysql docker instance. For Reference i am following this link -> http://www.servermom.org/pull-docker-images-run-docker-containers/3225/ But even after trying with multiple variations i am not achieving what i intend to. So what i am doing is after adding new tables and schema to my container i am committing & pushing to Docker hub as mentioned in the

Open file inside docker container has been shut down

烈酒焚心 提交于 2019-12-11 12:23:35
问题 I start a mysql container and change the config file inside a container, in this case is /etc/mysql/my.cnf . And restart container. Maybe something wrong with that config file and the container cannot start. How can I edit that config file when the container has been shutdown? 回答1: A container is immutable, your changes and conf are gone. You should use a Dockerfile to build a custom image and include my.cnf. It can be easily done, create a folder, create my.cnf in it and a Dockerfile with

Mapping docker port is failed

左心房为你撑大大i 提交于 2019-12-11 05:41:07
问题 Created new docker image(rm/node:10.0) with centos7 using below dockerfile. FROM rm/node:9.0 EXPOSE 3000 WORKDIR /Reader_Manager/SISPlatform/Auth RUN npm install WORKDIR /Reader_Manager/SISPlatform/Auth/portal CMD npm run-script dev-server-linux "npm run-script dev-server-linux" will invoke below command which defined in package.json file "dev-server-linux": "export NODE_ENV=development && pm2 start --no-daemon AuthServer -o ../../logs/pm2/out/auth_out.log -e ../../logs/pm2/err/auth_error.log