pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
building a singularity image from docker hub postgres image
3+ messages / 2 participants
[nested] [flat]

* building a singularity image from docker hub postgres image
@ 2024-01-30 05:52 Allan Kamau <kamauallan@gmail.com>
  2024-01-30 09:27 ` Re: building a singularity image from docker hub postgres image Justin Clift <justin@postgresql.org>
  0 siblings, 1 reply; 3+ messages in thread

From: Allan Kamau @ 2024-01-30 05:52 UTC (permalink / raw)
  To: pgsql-general

I am trying to build a singularity image from postgres docker image.
I am issuing the command below.

$ singularity build /local/data/some/postgres.16.1.sif
docker://postgres/postgres:16.1

INFO:    Starting build...
INFO:    Fetching OCI image...
FATAL:   While performing build: conveyor failed to get: GET
https://index.docker.io/v2/postgres/postgres/manifests/16.1: UNAUTHORIZED:
authentication required; [map[Action:pull Class: Name:postgres/postgres
Type:repository]]


What is the url I should use?

-Allan.

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: building a singularity image from docker hub postgres image
  2024-01-30 05:52 building a singularity image from docker hub postgres image Allan Kamau <kamauallan@gmail.com>
@ 2024-01-30 09:27 ` Justin Clift <justin@postgresql.org>
  2024-02-01 10:50   ` Re: building a singularity image from docker hub postgres image Allan Kamau <kamauallan@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Justin Clift @ 2024-01-30 09:27 UTC (permalink / raw)
  To: Allan Kamau <kamauallan@gmail.com>; +Cc: pgsql-general

On 2024-01-30 15:52, Allan Kamau wrote:
> I am trying to build a singularity image from postgres docker image.
> I am issuing the command below.
> 
> $ singularity build /local/data/some/postgres.16.1.sif
> docker://postgres/postgres:16.1
> 
> INFO:    Starting build...
> INFO:    Fetching OCI image...
> FATAL:   While performing build: conveyor failed to get: GET
> https://index.docker.io/v2/postgres/postgres/manifests/16.1: 
> UNAUTHORIZED:
> authentication required; [map[Action:pull Class: Name:postgres/postgres
> Type:repository]]
> 
> What is the url I should use?

Not personally familiar with Singularity, but this post looks like it
should help:

   
https://www.linuxwave.info/2022/04/running-postgresql-database-using.html

The example command they have there is:

   singularity pull docker://postgres:14.2-alpine3.15

So the format of the url *seems* like it should be:

   docker://postgres:16.1

That just pure guess work though. :)

Regards and best wishes,

Justin Clift





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: building a singularity image from docker hub postgres image
  2024-01-30 05:52 building a singularity image from docker hub postgres image Allan Kamau <kamauallan@gmail.com>
  2024-01-30 09:27 ` Re: building a singularity image from docker hub postgres image Justin Clift <justin@postgresql.org>
@ 2024-02-01 10:50   ` Allan Kamau <kamauallan@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Allan Kamau @ 2024-02-01 10:50 UTC (permalink / raw)
  To: Justin Clift <justin@postgresql.org>; +Cc: pgsql-general

On Tue, Jan 30, 2024 at 12:27 PM Justin Clift <justin@postgresql.org> wrote:

> On 2024-01-30 15:52, Allan Kamau wrote:
> > I am trying to build a singularity image from postgres docker image.
> > I am issuing the command below.
> >
> > $ singularity build /local/data/some/postgres.16.1.sif
> > docker://postgres/postgres:16.1
> >
> > INFO:    Starting build...
> > INFO:    Fetching OCI image...
> > FATAL:   While performing build: conveyor failed to get: GET
> > https://index.docker.io/v2/postgres/postgres/manifests/16.1:
> > UNAUTHORIZED:
> > authentication required; [map[Action:pull Class: Name:postgres/postgres
> > Type:repository]]
> >
> > What is the url I should use?
>
> Not personally familiar with Singularity, but this post looks like it
> should help:
>
>
> https://www.linuxwave.info/2022/04/running-postgresql-database-using.html
>
> The example command they have there is:
>
>    singularity pull docker://postgres:14.2-alpine3.15
>
> So the format of the url *seems* like it should be:
>
>    docker://postgres:16.1
>
> That just pure guess work though. :)
>
> Regards and best wishes,
>
> Justin Clift
>


Thanks Justin for the corrections and resources.
I have now put together the command below that does what I was looking for.

$ cd /tmp/;singularity pull postgres_16.1-alpine3.19.sif
docker://postgres:16.1-alpine3.19;

I am using the singularity container for the postgresql binaries instead
of having to install the binaries on the computer. For example I am using
pg_dump to take backups.


This could be of help to others, below is an example of using the
PostgreSQL binaries in the singularity image built from PostgreSQL docker
image.

##construct the singularity image
singularity_image_dfn="/local/data/bcl-sdv/singularity/pg";
mkdir -p "${singularity_image_dfn}";
date;time singularity build
"${singularity_image_dfn}"/postgres.16.1-alpine3.19.sif
docker://postgres/postgres:16.1-alpine3.19;date;

##Example usage of the singularity image
date;time {

singularity_image_fn="/local/data/bcl-sdv/singularity/pg/postgres_16.1-alpine3.19.sif";
    date;time singularity exec \
        --workdir /tmp \
        "${singularity_image_fn}" \
            "psql" \

"postgresql://someusername:somepassword@somehostname:5423/some_db_name"
\
                "-c" \
                "SELECT version();" \
    ;date;
};date;


Allan.

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2024-02-01 10:50 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-01-30 05:52 building a singularity image from docker hub postgres image Allan Kamau <kamauallan@gmail.com>
2024-01-30 09:27 ` Justin Clift <justin@postgresql.org>
2024-02-01 10:50   ` Allan Kamau <kamauallan@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox