CKAN Docker container not running - docker

I am running the example installation using docker container from the CKAN site. A clean run, that downloads fresh (no local images) gives no errors
docker run -d --name db ckan/postgresql
docker run -d --name solr ckan/solr
docker run -d -p 80:80 --link db:db --link solr:solr ckan/ckan
but then a "docker ps" does not have the ckan image running ...
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
90c6e6a77b0a ckan/solr:latest "java -jar start.jar 15 minutes ago Up 15 minutes 8983/tcp solr
53f9a9f5c145 ckan/postgresql:latest "/usr/local/bin/run" 20 minutes ago Up 20 minutes 5432/tcp db
Where would errors show?

docker ps only lists running containers. You have to pass in the -a option in order to list all containers you have run
docker ps -a
Find the right container and run the following command to see any error messages it may have reported before shutting down
docker logs <container_id>

As at March 6 2015 described at https://github.com/ckan/ckan/issues/2255
ensure that you have killed off any solr containers still running using
docker rm <idnumber>
then use the more recent schema config
wget https://github.com/ckan/ckan/blob/master/ckan/config/solr/schema.xml
docker run -d --name solr -v `pwd`/schema.xml:/opt/solr/example/solr/ckan/conf/schema.xml ckan/solr
then repeat the original failing step:
docker run -d -p 80:80 --link db:db --link solr:solr ckan/ckan
-- EDIT -- This looks like it works but it introduces other problems.
Am going to experiment with suggestion to use https://github.com/datacats/datacats

Related

Nexus container exit(1) when run

I am trying to run nexus on EC2 ubuntu machine.
docker pull sonatype/nexus3
docker run -d -p 8081:8081 --name nexus sonatype/nexus3
running containers
# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a0562da202f7 sonatype/nexus3 "sh -c ${SONATYPE_DI…" 7 seconds ago **Exited (1) 5 seconds ago nexus**
#
Please do let me know what is going wrong here.
I tried to reproduce the problem and I face the same as you tried, I resolve this by setting these variables.
docker run -it --rm -p 8081:8081 --name nexus -e INSTALL4J_ADD_VM_PARAMS="-Xms2g -Xmx2g -XX:MaxDirectMemorySize=3g -Djava.util.prefs.userRoot=/some-other-dir" sonatype/nexus3
Also, you can read the system requirement
Notes
Our system requirements should be taken into account when provisioning the Docker container.
There is an environment variable that is being used to pass JVM arguments to the startup script
INSTALL4J_ADD_VM_PARAMS, passed to the Install4J startup script. Defaults to -Xms2703m -Xmx2703m -XX:MaxDirectMemorySize=2703m -Djava.util.prefs.userRoot=${NEXUS_DATA}/javaprefs.

docker container is active but port is not displayed

I am building a docker image and running it will following command:
docker run --name myjenkins -u root -d -p 8080:8080 -p 50000:50000 -v jenkins-volume:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock --net=host vm31
docker container is up and running when i do docker ps output is :
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
22a92a3b7875 vm31 "/sbin/tini -- /usr/…" 4 seconds ago Up 3 seconds
why does not it show the port on which this container is running - so i can not reach jenkins on localhost:8080
You are using two conflicting things together:
--net=host
-p 8080:8080 -p 50000:50000
The first tells the container to use the network stack of the host, the second is the way to bind container ports with host ports. I believe you only want to use the second one.
try after removing option --net=host.

pact-broker docker image is not running after restarting docker machine

I am using Postgres image and past broker image in my docker machine for setting up pact broker.
here are 4 steps that have mentioned :
1.$ docker run --name pactbroker-db -e POSTGRES_PASSWORD=ThePostgresPassword -e POSTGRES_USER=admin -e PGDATA=/var/lib/postgresql/data/pgdata -v /var/lib/postgresql/data:/var/lib/postgresql/data -d postgres
2.$ docker run -it --link pactbroker-db:postgres --rm postgres sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U admin'
3.
CREATE USER pactbrokeruser WITH PASSWORD 'TheUserPassword';
CREATE DATABASE pactbroker WITH OWNER pactbrokeruser;
GRANT ALL PRIVILEGES ON DATABASE pactbroker TO pactbrokeruser;
4. docker run --name pactbroker --link pactbroker-db:postgres -e PACT_BROKER_DATABASE_USERNAME=pactbrokeruser -e PACT_BROKER_DATABASE_PASSWORD=TheUserPassword -e PACT_BROKER_DATABASE_HOST=postgres -e PACT_BROKER_DATABASE_NAME=pactbroker -d -p 80:80 dius/pact_broker
after running this 4 command when I am opening Hal browser in my local system it is working pretty fine. Now I am stopping 2 docker containers pactbroker-db and pactbroker and stopping docker machine.
After sometime I am restarting docker machine and starting the containers by
$docker start pactbroker-db and $docker start pactbroker .
containers are getting started but when opening HAL browser I am getting the error "We're sorry, but something went wrong." screenshot attached.
Is there something wrong when I am starting the docker 2nd time?enter image description here
This has been resolved by using container given in https://github.com/DiUS/pact_broker-docker and using proper environment variables in docker-compose.yml of this project.

Mariadb failure to daemonise with docker

I'm trying to use this image https://hub.docker.com/_/mariadb/ (any version).
I'm using the following to launch the container:
cd maria
docker build -t maria-image .
docker run --name maria maria-image -d -e MYSQL_ALLOW_EMPTY_PASSWORD=1
cd ..
I'm preparing a custom build in case I need to do any future modifications so that lives in maria/Dockerfile with the following:
FROM mariadb:5.5
MAINTAINER ...
EXPOSE 3306
If I do docker ps -a I get status "Exited (2) 5 seconds ago".
Your args appear to be in the wrong order, maria-image should be after all other docker run args:
docker run --name maria -d -e MYSQL_ALLOW_EMPTY_PASSWORD=1 maria-image
The version you ran passed the -d and -e as the command for docker to run. Note that you'll want to first run docker rm -v maria to free the container name for reuse.

Docker CMD to start Haproxy in Dockerfile

Here is my CMD command in my Dockerfile for haproxy:
CMD ["/etc/init.d/haproxy"]
Now when I run the image the following happens:
...
Successfully built 2eb6549e0a22
root#server:/# docker run -d -p 80:80 -p 81:81 -p 443:443 -p 1988:1988 --name haproxy -h haproxy user/haproxy
09b510c4df712414d8855d3e0fb27b7e35d5c5c2f0f9b07f7f29c8efdb93e852
root#server:/# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
09b510c4df71 user/haproxy "/etc/init.d/haproxy" 5 seconds ago Exited (2) 4 seconds ago haproxy
As you can see it exits straight away. How do I keep it running?
Does your user/haproxy inherit from the haproxy container in the main docker repo? If so the command haproxy should be in the PATH and it includes a -f flag for running it in the foreground.
I usually specify the config file too, so my CMD looks like:
haproxy -d -f /usr/local/etc/haproxy/haproxy.cfg

Resources