KhaledHosseini / play-microservices

A simple job scheduler microservice application using various programming languages for different services to demonstrate the flexibility of microservices architecture in terms of independence from specific technologies..
MIT License
17 stars 4 forks source link

Received an error due to not passing the `-y` flag to `apt-get install libpq-dev` in Dockerfile #2

Open JohnScience opened 9 months ago

JohnScience commented 9 months ago
 => CANCELED [report 1/5] FROM docker.io/library/python:3.11.4@sha256:85b3d192dddbc96588b719e86991e472b390805a754681a38132de1977d8e429     20.0s
 => => resolve docker.io/library/python:3.11.4@sha256:85b3d192dddbc96588b719e86991e472b390805a754681a38132de1977d8e429                      0.2s
 => => sha256:85b3d192dddbc96588b719e86991e472b390805a754681a38132de1977d8e429 2.14kB / 2.14kB                                              0.0s
 => => sha256:35469d11bde33a2f1cc54c04f64451275e09985bebf23a101a51e28a1774f548 2.01kB / 2.01kB                                              0.0s
 => => sha256:cd9c1d09c0875beccec67491cf012e11a0935500b407563466a61b3d45efc5a0 7.53kB / 7.53kB                                              0.0s
 => [emailjob internal] load build context                                                                                                  0.4s
 => => transferring context: 770B                                                                                                           0.3s
------
 > [auth base 2/8] RUN apt-get update && apt-get install -y unzip && apt-get install libpq-dev:
4.829 Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
5.402 Get:2 http://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]
5.790 Get:3 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
6.202 Get:4 http://deb.debian.org/debian bullseye/main amd64 Packages [8068 kB]
8.159 Get:5 http://deb.debian.org/debian-security bullseye-security/main amd64 Packages [268 kB]
8.478 Get:6 http://deb.debian.org/debian bullseye-updates/main amd64 Packages [18.8 kB]
10.78 Fetched 8563 kB in 7s (1314 kB/s)
10.78 Reading package lists...
12.40 Reading package lists...
13.90 Building dependency tree...
14.15 Reading state information...
14.62 unzip is already the newest version (6.0-26+deb11u1).
14.62 0 upgraded, 0 newly installed, 0 to remove and 90 not upgraded.
14.63 Reading package lists...
16.66 Building dependency tree...
17.12 Reading state information...
18.44 The following additional packages will be installed:
18.44   libpq5
18.46 Suggested packages:
18.46   postgresql-doc-13
18.56 The following packages will be upgraded:
18.56   libpq-dev libpq5
18.61 2 upgraded, 0 newly installed, 0 to remove and 88 not upgraded.
18.61 Need to get 323 kB of archives.
18.61 After this operation, 2048 B of additional disk space will be used.
18.61 Do you want to continue? [Y/n] Abort.
------
failed to solve: process "/bin/sh -c apt-get update && apt-get install -y unzip && apt-get install libpq-dev" did not complete successfully: exit code: 1

Fixing the problem in a fork.

Located the problem:

C:\Users\USER\Documents\github\play-microservices>rg "apt-get update && apt-get install -y unzip && apt-get install libpq-dev"
auth\README.md
327:RUN apt-get update && apt-get install -y unzip && apt-get install libpq-dev

auth\auth-service\Dockerfile.test
4:RUN apt-get update && apt-get install -y unzip && apt-get install libpq-dev

auth\auth-service\Dockerfile
4:RUN apt-get update && apt-get install -y unzip && apt-get install libpq-dev

C:\Users\USER\Documents\github\play-microservices>code auth\auth-service\

...

After fixing multiple errors, I realized that there's too much to fix.

KhaledHosseini commented 9 months ago

"libpq-dev" is a package in Debian-based Linux distributions that contains the development files (headers and libraries) needed to build programs that use the PostgreSQL database system. Here it is being used by Diesel CLI in the development environment. If you are not going to use diesel CLI, just comment it out from the docker file. But I have no problem installing it.