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 1nTENA-000186-L9 for pgsql-bugs@arkaria.postgresql.org; Sun, 13 Mar 2022 02:54:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nTEN8-0003S2-My for pgsql-bugs@arkaria.postgresql.org; Sun, 13 Mar 2022 02:54:18 +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 1nTEN8-0003Rt-DA for pgsql-bugs@lists.postgresql.org; Sun, 13 Mar 2022 02:54:18 +0000 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nTEN2-0007aU-Tm for pgsql-bugs@lists.postgresql.org; Sun, 13 Mar 2022 02:54:17 +0000 Received: by mail-pf1-x42f.google.com with SMTP id u17so9126488pfk.11 for ; Sat, 12 Mar 2022 18:54:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=i8atfVyxhxXveIpDeOHZhSNkxoYU/H1aUIX5MThAXWk=; b=CvoPEYfRwjrLpD4l1wJXCE2eNiF71YF5D3voe0+8mokUtFb9bj/Mu0H5iLA5rWWXqt fxLP9ACx2hITyikixmzGGk854FEUWMFDwTOCYUWD3A0sjq5GQtgFkrRYQDkfY+L3vvwQ URYnvqoq6EDhPd8DE45nNmwjGy7UyKvtLcILWoEVsSl07vqcUDAmQceUcaHiBevgwiH3 vWcmiQLgc5+h24UBi6Mno5xTzmIS1Bl7ca9lxJVxiI1LtOXVcM5U6u4r4pu4BIgM6O// OHeHnWQDORIeSL+4gKWEAwr3uB1RSk3zBpcdPNaS3HOWOcUnDI/bOXeaziywTCOqvkM9 ApeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=i8atfVyxhxXveIpDeOHZhSNkxoYU/H1aUIX5MThAXWk=; b=BxGQxZozNZtyocp3L83Sdh4oPkFBKBZOcfhY/hC6hmyMAxxesQ1y7n1bNd+MOq5KTh YeXOYdze2uLnH4py/UB8/c71Xq7P4qj5SOuUZ1QRY8au0wx9lEWXqAkQABXjffMCXr7/ hk3n+A0QxTVunhPAEvlzODiSmgUCLEdWbzrPtn3/0LtxOyhyQSqAibKIsiaK7bujWKRJ 3ENtjGK4UGV9J9SrDBeIE1rEtuFeuxxrHR55QgCa0yevfE65QJvqs1/FfEEEXNmniALe dDPBGzd5zEJeKX2992cr1md5XVq0RsUZRzbX8DbsKsKLLzivP9aniGrlLNa6Y5PyVyMj ++Ag== X-Gm-Message-State: AOAM533nA2bRfT2Lp9xjeuo51tiH01BJRHjEB/c+rOLyWmrZ5Maoclog Vd1grMqg42eEeaX504RqhNQ= X-Google-Smtp-Source: ABdhPJxiWTpD2CyQG79aW2Y2m2ZhRRZTBfiF+ArMyqN7yqU6Jgm/3PMtJSncpOw1plONaddZovCHPQ== X-Received: by 2002:a63:202:0:b0:37c:4cfc:b89f with SMTP id 2-20020a630202000000b0037c4cfcb89fmr14527194pgc.396.1647140050591; Sat, 12 Mar 2022 18:54:10 -0800 (PST) Received: from jrouhaud (2001-b011-1005-b913-a190-391c-5f89-ea82.dynamic-ip6.hinet.net. [2001:b011:1005:b913:a190:391c:5f89:ea82]) by smtp.gmail.com with ESMTPSA id 3-20020a17090a030300b001c17851b6a1sm9263031pje.28.2022.03.12.18.54.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Mar 2022 18:54:09 -0800 (PST) Date: Sun, 13 Mar 2022 10:53:46 +0800 From: Julien Rouhaud To: "David G. Johnston" Cc: dkeate@gmail.com, PostgreSQL mailing lists Subject: Re: BUG #17436: Initializing and starting with Dockerfile fails Message-ID: <20220313025346.obdsdilb4eygjlft@jrouhaud> References: <17436-b8a4a3dd58c54838@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Mar 12, 2022 at 07:24:26PM -0700, David G. Johnston wrote: > > Though I am curious that initdb didn't fail during the build since it > doesn't seem like either -D or PGDATA have been set and one of those is > required. I suppose it ended up using an unexpected location that didn't > match up with the -D option to pg_ctl. If you look a few lines above the link I sent you can see the PGDATA env being set to the same location. The problem is only that this location is a volume. > It is indeed possible to do what you are trying - to bake in an active > database into the docker image, and not rely on a separate mounted volume > for the database. But that also isn't really how the existing image is > setup to be used and so you will need to figure out the customizations > needed to make it do what you want Also using the container layer to write data will perform ridiculously bad. If the goal is only to read the data that might be ok, but maybe not. I think the OP should better ask on Docker specific lists for guidance.