Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jaP0N-0004Vn-Pa for pgsql-admin@arkaria.postgresql.org; Sun, 17 May 2020 19:31:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jaOzo-0003jk-Uo for pgsql-admin@arkaria.postgresql.org; Sun, 17 May 2020 19:30:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jaOzo-0003jd-HR for pgsql-admin@lists.postgresql.org; Sun, 17 May 2020 19:30:48 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jaOzk-0002ke-Me for pgsql-admin@lists.postgresql.org; Sun, 17 May 2020 19:30:47 +0000 Received: by mail-pf1-x442.google.com with SMTP id y198so2282368pfb.4 for ; Sun, 17 May 2020 12:30:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gisticinc-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=7vJgXC1mianBAC7jeI7yFXTWKdi3ny5kfgDX2ehR+k4=; b=rCNmxt8XDFZWgI/FU1sXpgP/VuJ6HMRRoaWyOsEfxySRQODviQvjtWYYZ4HFtH0pdR ycMnnC2751fTqhGzRCSs3nNeuwu8uCTe0s8TeX8n9ULY3MB9ksMeuICJuAUbb3TvXgHe lSmmrHxyNFogn3iRm6Mdwg/xUM2adqzTm+5frKGGqAJNzgyW+BCObDwKVbIyaT+DJJ6S iWpN4+VLfLk2glsJipBuvO4XGWmwA/iYY4dFfiuqDygLMxPvHQlPcTBUk9YTa+SB8jD6 b4W4eOjelMtQOUH+m/1YwuGJ6UDDu4zZacdljihrBI+lM3CFgCVvLK8eP+gRB6VkJ9Qr aysw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=7vJgXC1mianBAC7jeI7yFXTWKdi3ny5kfgDX2ehR+k4=; b=CszHFpunpitPVgjpJgZQOU1pwJ39taPqKsR869EQ/NYEYCS1Z3ID9uZfNCj1WXYx/8 1FBPShNqk4KUN70N3YimkXLNDbf84Vz3MXL2Bh9Xu+h7ottYZSKNXBcTixn280BigE4g G0hLRXKeTsSdJ7G1tZ0ZMUkVTlZZvpLIDQtAdUoCivEhLM09YJIHLGMLJguZUPHu1jZ3 TQcGBJ+IBGNXdfaL3KxnA4uJHRGMDGaqNSgSW830vxVI6VstE8nl9nsjXiBfFqDSWol3 1mahEXCwDcaodXv1Nlelm8HDGdI6NVgJ3XHIqoEqHDU8jSYlhgExqZwSmAAPolPEA600 ziYw== X-Gm-Message-State: AOAM531Gwg+NIqLr6YyCbiDdrHkkYPFLUb6q/SexVLy5qZJS7aZVE3lf MifdYy+Nn3Wvwat+QG7ghTeXzFuyviE= X-Google-Smtp-Source: ABdhPJy9nn7VXkYuG3PIFjnZiCulQCwWiK+komoNOLu5X6+bwTmqlc4y5Di0XTxb3nerrYIJGtTrnA== X-Received: by 2002:a63:fd15:: with SMTP id d21mr11577979pgh.31.1589743841256; Sun, 17 May 2020 12:30:41 -0700 (PDT) Received: from snowflake.tempe.gistic.com (wsip-72-215-195-71.ph.ph.cox.net. [72.215.195.71]) by smtp.gmail.com with ESMTPSA id e13sm6794984pfh.19.2020.05.17.12.30.40 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 May 2020 12:30:40 -0700 (PDT) Subject: pgadmin4 container install: volume mapping not working To: pgsql-admin@lists.postgresql.org References: From: Bo Guo Message-ID: Date: Sun, 17 May 2020 12:30:39 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------CA13B37D581AC017FF550C66" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------CA13B37D581AC017FF550C66 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi list, I have been using the docker container install of pgAdmin4 for about a year and half, during which time I tried several times trying to make volume mapping work, in vein. Yes, the docker installation is very clean and simple.  But I just could not make volume mapping to work so that script file saved can be accessed easily and server connections or any session related history etc. can be preserved when updating to use the latest container images.  I hope someone can provide a pointer or two to help me. Here is what I used to create the instance docker run --name "pgadmin4.21" \ -p 5050:80 \ -e 'PGADMIN_DEFAULT_EMAIL=pgadmin@example.com' \ -e 'PGADMIN_DEFAULT_PASSWORD=123456' \ -d dpage/pgadmin4 \ -v /opt/pgadmin_session:/var/lib/pgadmin \ -v /opt/pgadmin_config:/pgadmin4 Docker Inspection shows the container having             "Env": [                 "PGADMIN_DEFAULT_EMAIL=pgadmin@example.com",                 "PGADMIN_DEFAULT_PASSWORD=123456",                 "PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",                 "LANG=C.UTF-8",                 "GPG_KEY=0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D",                 "PYTHON_VERSION=3.7.7",                 "PYTHON_PIP_VERSION=20.0.2",                 "PYTHON_GET_PIP_URL=https://github.com/pypa/get-pip/raw/d59197a3c169cef378a22428a3fa99d33e080a5d/get-pip.py",                 "PYTHON_GET_PIP_SHA256=421ac1d44c0cf9730a088e337867d974b91bdce4ea2636099275071878cc189e",                 "PYTHONPATH=/pgadmin4"             ],             "Cmd": [                 "-v",                 "/opt/pgadmin_session:/var/lib/pgadmin",                 "-v",                 "/opt/pgadmin_config:/pgadmin4"             ], Before I start the container instance, I made sure the folders were accessible sudo mkdir /opt/pgadmin_session sudo mkdir /opt/pgadmin_config sudo chown 5050:5050 /opt/pgadmin_session sudo chown 5050:5050 /opt/pgadmin_config sudo chmod -R 777 /opt/pgadmin_session sudo chmod -R 777 /opt/pgadmin_config Cheers! Bo --------------CA13B37D581AC017FF550C66 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Hi list,

I have been using the docker container install of pgAdmin4 for about a year and half, during which time I tried several times trying to make volume mapping work, in vein.

Yes, the docker installation is very clean and simple.  But I just could not make volume mapping to work so that script file saved can be accessed easily and server connections or any session related history etc. can be preserved when updating to use the latest container images.  I hope someone can provide a pointer or two to help me.

Here is what I used to create the instance

docker run --name "pgadmin4.21" \ 
-p 5050:80 \ 
-e 'PGADMIN_DEFAULT_EMAIL=pgadmin@example.com' \ 
-e 'PGADMIN_DEFAULT_PASSWORD=123456' \ 
-d dpage/pgadmin4 \ 
-v /opt/pgadmin_session:/var/lib/pgadmin \ 
-v /opt/pgadmin_config:/pgadmin4 

Docker Inspection shows the container having

            "Env": [
                "PGADMIN_DEFAULT_EMAIL=pgadmin@example.com",
                "PGADMIN_DEFAULT_PASSWORD=123456",
                "PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "LANG=C.UTF-8",
                "GPG_KEY=0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D",
                "PYTHON_VERSION=3.7.7",
                "PYTHON_PIP_VERSION=20.0.2",
                "PYTHON_GET_PIP_URL=https://github.com/pypa/get-pip/raw/d59197a3c169cef378a22428a3fa99d33e080a5d/get-pip.py",
                "PYTHON_GET_PIP_SHA256=421ac1d44c0cf9730a088e337867d974b91bdce4ea2636099275071878cc189e",
                "PYTHONPATH=/pgadmin4"
            ],
            "Cmd": [
                "-v",
                "/opt/pgadmin_session:/var/lib/pgadmin",
                "-v",
                "/opt/pgadmin_config:/pgadmin4"
            ],

Before I start the container instance, I made sure the folders were accessible

sudo mkdir /opt/pgadmin_session 
sudo mkdir /opt/pgadmin_config 
sudo chown 5050:5050  /opt/pgadmin_session 
sudo chown 5050:5050  /opt/pgadmin_config 
sudo chmod -R 777 /opt/pgadmin_session 
sudo chmod -R 777 /opt/pgadmin_config

Cheers!

Bo

--------------CA13B37D581AC017FF550C66--