Showing posts with label Docker. Show all posts
Showing posts with label Docker. Show all posts

Thursday, November 10, 2022

Docker: failed to create LLB definition

I was getting this weird error on Docker for the same container that was building fine just minutes go.

 $ docker build -t hummingbird:1.0.0 .
[+] Building 0.3s (3/3) FINISHED
 => [internal] load build definition from Dockerfile                                              0.0s
 => => transferring dockerfile: 37B                                                               0.0s
 => [internal] load .dockerignore                                                                 0.0s
 => => transferring context: 2B                                                                   0.0s
 => ERROR [internal] load metadata for docker.io/cellprofiler/cellprofiler:4.0.6                  0.0s
------
 > [internal] load metadata for docker.io/cellprofiler/cellprofiler:4.0.6:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to do request: Head "https://registry-1.docker.io/v2/cellprofiler/cellprofiler/manifests/4.0.6": proxyconnect tcp: dial tcp 192.168.65.1:3128: connect: network is unreachable

Turned out, this error can appear when the disk is full (observed in MacOS), with no issue from the built container image itself. How did the desk get full within a few minutes? Of course, by building a few Docker containers and them remaining in cache. Deleting some files to get some storage space and restarting Docker made the build succeed again.

Friday, August 5, 2016

Configuring API Umbrella with LDAP - with containers

This is a live post on an on-going effort, configuring API Umbrella with LDAP, both in Docker containers.


Make the configuration file:
$ mkdir config && touch config/api-umbrella.yml

web:
  admin:
    initial_superusers:
      - pkathi2@emory.edu
    auth_strategies:
      enabled:
        - github
        - google
        - persona
        - ldap
      github:
        client_id: xxxxxxxxxxxxx
        client_secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      google:
        client_id: yyyyyy-yyyy.apps.googleusercontent.com
        client_secret: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
      ldap:
        options:
          host: lion.bmi.emory.edu
          port: 389
          base: dc=example, dc=org


Follow the wiki on configuring github and google authentication.
http://api-umbrella.readthedocs.io/en/latest/getting-started.html
                                               

Run the OpenLDAP Docker container:
sudo docker run --hostname lion.bmi.emory.edu  -p 389:389 -p 636:636 --name my-openldap-container --detach osixia/openldap:1.1.5


Run the API Umbrella Docker container:
sudo docker run -d --name=api-umbrella -p 80:80 -p 443:443  --link my-openldap-container:ldap -v $PWD/config:/etc/api-umbrella \
-v /var/log/api-umbrella/nginx:/var/log/api-umbrella/nginx \
           -v /var/log/api-umbrella/web-puma/current:/var/log/api-umbrella/web-puma/current \
           -v /var/log/api-umbrella/trafficserver/access.blog:/var/log/api-umbrella/trafficserver/access.blog \
nrel/api-umbrella




Unfortunately when ldap is enabled in the configuration file, https://lion.bmi.emory.edu/admin/ is throwing a gateway timeout. This might be something to do with the OmniAuth LDAP configurations. The documentation is still an issue with API Umbrella, just like other API gateways that I tried recently.

This issue also has been reported to API Umbrella team.

Wednesday, August 3, 2016

Installing DCM4CHEE using Docker

DCM4CHEE Admin Page.
DCM4CHEE installation through Docker was the smoothest installation/configuration I did recently. Despite its complicated setting environment with WildFly, OpenLDAP, and PostgreSQL, everything was simple and to the point, thanks to Docker and the compact documentation provided by DCM4CHEE.
This blog post is based on the wiki page, which is in itself well written.

Add docker host to the /etc/hosts file
127.0.0.1 dockerhost

Make sure that the Docker is started.
sudo service docker start


Run OpenLDAP Server

sudo docker run --name slapd \
           -p 389:389 \
           -e LDAP_BASE_DN=dc=dcm4che,dc=org \
           -e LDAP_ORGANISATION=dcm4che.org \
           -e LDAP_ROOTPASS=secret \
           -e LDAP_CONFIGPASS=secret \
           -e DEVICE_NAME=dcm4chee-arc \
           -e AE_TITLE=DCM4CHEE \
           -e DICOM_HOST=dockerhost \
           -e DICOM_PORT=11112 \
           -e HL7_PORT=2575 \
           -e SYSLOG_HOST=logstash \
           -e SYSLOG_PORT=8512 \
           -e SYSLOG_PROTOCOL=UDP \
           -e STORAGE_DIR=/storage/fs1 \
           -v /var/local/dcm4chee-arc/ldap:/var/lib/ldap \
           -v /var/local/dcm4chee-arc/slapd.d:/etc/ldap/slapd.d \
           -d dcm4che/slapd-dcm4chee:5.5.2




Run PostgreSQL Server

sudo docker run --name postgres \
           -p 5432:5432 \
           -e POSTGRES_DB=pacsdb \
           -e POSTGRES_USER=pacs\
           -e POSTGRES_PASSWORD=pacs \
           -v /var/local/dcm4chee-arc/db:/var/lib/postgresql/data \
           -d dcm4che/postgres-dcm4chee:5.2



Run DCM4CHEE Archive 5

We choose version with secured UI and secured RESTful services (Tag Name: 5.5.2-secure).

sudo docker run --name dcm4chee-arc \
           -p 8080:8080 \
           -p 9990:9990 \
           -p 11112:11112 \
           -p 2575:2575 \
           -e LDAP_BASE_DN=dc=dcm4che,dc=org \
           -e LDAP_ROOTPASS=secret \
           -e LDAP_CONFIGPASS=secret \
           -e DEVICE_NAME=dcm4chee-arc \
           -e POSTGRES_DB=pacsdb \
           -e POSTGRES_USER=pacs\
           -e POSTGRES_PASSWORD=pacs \
           -e JAVA_OPTS="-Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true" \
           -e WILDFLY_CHOWN="/opt/wildfly/standalone /storage" \
           -v /var/local/dcm4chee-arc/wildfly:/opt/wildfly/standalone \
           -v /var/local/dcm4chee-arc/storage:/storage \
           --link slapd:ldap \
           --link postgres:db \
           -d dcm4che/dcm4chee-arc-psql:5.5.2-secure


Make sure that no port conflicts:
sudo netstat -anp | grep

Due to failed attempts, there may be conflicts in starting a Docker container.
docker: Error response from daemon: Conflict. The name "/dcm4chee-arc" is already in use by container 537bd21a41bb01680ea598ad35a33a1cc07d1d222dc75605c64398c7a43fb73c. You have to remove (or rename) that container to be able to reuse that name..

Find and remove the contaianer and re-attempt if this happens.
sudo docker ps -a
537bd21a41bb        dcm4che/dcm4chee-arc-psql:5.5.2-secure   "/docker-entrypoint.s"   3 minutes ago       Created                                              dcm4chee-arc

sudo docker rm 537bd21a41bb

or just,
sudo docker rm slapd
sudo docker rm postgres
sudo docker rm dcm4chee-arc

Check the status of the Docker containers after everything has started
 sudo docker ps -a
CONTAINER ID        IMAGE                                    COMMAND                  CREATED             STATUS                     PORTS                                                                                              NAMES
6cbfcb336f65        dcm4che/dcm4chee-arc-psql:5.5.2-secure   "/docker-entrypoint.s"   6 seconds ago       Up 3 seconds               0.0.0.0:2575->2575/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:9990->9990/tcp, 0.0.0.0:11112->11112/tcp   dcm4chee-arc
a5cf7e96ba0e        dcm4che/postgres-dcm4chee:5.2            "/docker-entrypoint.s"   8 minutes ago       Up 8 minutes               0.0.0.0:5432->5432/tcp                                                                             postgres
43d3eb7e1237        dcm4che/slapd-dcm4chee:5.5.2             "/docker-entrypoint.s"   25 minutes ago      Up 25 minutes              0.0.0.0:389->389/tcp                                                                               slapd




Web Service URLs

    Archive UI: http://localhost:8080/dcm4chee-arc/ui - if secured, login with
    Username     Password     Role
    user     user     user
    admin     admin     user + admin
    Keycloak Administration Console: http://localhost:8080/auth, login with Username: admin, Password: admin.
    Wildfly Administration Console: http://localhost:9990, login with Username: admin, Password: admin.
    Kibana UI: http://localhost:5601
    DICOM QIDO-RS Base URL: http://localhost:8080/dcm4chee-arc/aets/DCM4CHEE/rs
    DICOM STOW-RS Base URL: http://localhost:8080/dcm4chee-arc/aets/DCM4CHEE/rs
    DICOM WADO-RS Base URL: http://localhost:8080/dcm4chee-arc/aets/DCM4CHEE/rs
    DICOM WADO-URI: http://localhost:8080/dcm4chee-arc/aets/DCM4CHEE/wado



Check the logs of the containers
sudo docker logs 6cbfcb336f65


Restart a container
sudo docker restart 6cbfcb336f65


Entering a containerized instance for Debugging, etc

sudo docker exec -i -t dcm4chee-arc /bin/bash

*********************

Optionally, to store the log and audit messages in Elastic search, run these additional containers.

Run Elasticsearch

sudo docker run --name elasticsearch \
 -p 9200:9200 \
 -p 9300:9300 \
 -v /var/local/dcm4chee-arc/elasticsearch:/usr/share/elasticsearch/data \
 -d elasticsearch:2.2

 

Run Logstash

sudo docker run --name logstash \
 -p 12201:12201/udp \
 -p 8514:8514/udp \
 -p 8514:8514 \
 -v /var/local/dcm4chee-arc/elasticsearch:/usr/share/elasticsearch/data \
 --link elasticsearch:elasticsearch \
 -d dcm4che/logstash-dcm4chee
(the official documentation points to version 5.5.2 which is non-existent).

 

 Run Kibana

sudo docker run --name kibana \
 -p 5601:5601 \
 --link elasticsearch:elasticsearch \
  -d kibana:4.4

Also now you need to run the DCM4CHEE linking to the above optional containers to be able to retrieve the logs.

sudo docker run --name dcm4chee-arc \
           -p 8080:8080 \
           -p 9990:9990 \
           -p 11112:11112 \
           -p 2575:2575 \
           -e LDAP_BASE_DN=dc=dcm4che,dc=org \
           -e LDAP_ROOTPASS=secret \
           -e LDAP_CONFIGPASS=secret \
           -e DEVICE_NAME=dcm4chee-arc \
           -e POSTGRES_DB=pacsdb \
           -e POSTGRES_USER=pacs\
           -e POSTGRES_PASSWORD=pacs \
           -e JAVA_OPTS="-Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true" \
           -e WILDFLY_CHOWN="/opt/wildfly/standalone /storage" \
           -v /var/local/dcm4chee-arc/wildfly:/opt/wildfly/standalone \
           -v /var/local/dcm4chee-arc/storage:/storage \
           --link slapd:ldap \
           --link postgres:db \
           --link logstash:logstash \
           -d dcm4che/dcm4chee-arc-psql:5.5.2-logstash-secure