|
253 | 253 | paths = [ pgbin (makeReceipt pgbin upstreamExts ourExts) ];
|
254 | 254 | };
|
255 | 255 |
|
256 |
| - # Make a Docker Image from a given PostgreSQL version and binary package. |
257 |
| - # updated to use https://github.com/nlewo/nix2container (samrose) |
258 |
| - # makePostgresDocker = version: binPackage: |
259 |
| - # let |
260 |
| - # #system = builtins.currentSystem; |
261 |
| - # archString = if system == "aarch64-linux" then "arm64" |
262 |
| - # else if system == "x86_64-linux" then "amd64" |
263 |
| - # else throw "Unsupported system: ${system}"; |
264 |
| - |
265 |
| - # initScript = pkgs.runCommand "docker-init.sh" { } '' |
266 |
| - # mkdir -p $out/bin |
267 |
| - # substitute ${./nix/docker/init.sh.in} $out/bin/init.sh \ |
268 |
| - # --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' |
269 |
| - |
270 |
| - # chmod +x $out/bin/init.sh |
271 |
| - # ''; |
272 |
| - |
273 |
| - # postgresqlConfig = pkgs.runCommand "postgresql.conf" { } '' |
274 |
| - # mkdir -p $out/etc/ |
275 |
| - # substitute ${./nix/tests/postgresql.conf.in} $out/etc/postgresql.conf \ |
276 |
| - # --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' \ |
277 |
| - # --subst-var-by PGSODIUM_GETKEY_SCRIPT "${./nix/tests/util/pgsodium_getkey.sh}" |
278 |
| - # ''; |
279 |
| - |
280 |
| - # l = pkgs.lib // builtins; |
281 |
| - |
282 |
| - # user = "postgres"; |
283 |
| - # group = "postgres"; |
284 |
| - # uid = "1001"; |
285 |
| - # gid = "1001"; |
286 |
| - # wguid = "1002"; |
287 |
| - # wggid = "1002"; |
288 |
| - |
289 |
| - # mkUser = pkgs.runCommand "mkUser" { } '' |
290 |
| - # mkdir -p $out/etc/pam.d |
291 |
| - |
292 |
| - # echo "${user}:x:${uid}:${gid}::" > $out/etc/passwd |
293 |
| - # echo "${user}:!x:::::::" > $out/etc/shadow |
294 |
| - |
295 |
| - # echo "${group}:x:${gid}:" > $out/etc/group |
296 |
| - # echo "${group}:x::" > $out/etc/gshadow |
297 |
| - |
298 |
| - # echo "root:x:0:0::/root:/bin/bash" >> $out/etc/passwd |
299 |
| - # echo "root:x:0:" >> $out/etc/group |
300 |
| - |
301 |
| - # echo "wal-g:x:${wguid}:${wggid}::" >> $out/etc/passwd |
302 |
| - # echo "wal-g:x:${wggid}:" >> $out/etc/group |
303 |
| - |
304 |
| - # cat > $out/etc/pam.d/other <<EOF |
305 |
| - # account sufficient pam_unix.so |
306 |
| - # auth sufficient pam_rootok.so |
307 |
| - # password requisite pam_unix.so nullok sha512 |
308 |
| - # session required pam_unix.so |
309 |
| - # EOF |
310 |
| - |
311 |
| - # touch $out/etc/login.defs |
312 |
| - # ''; |
313 |
| - # run = pkgs.runCommand "run" { } '' |
314 |
| - # mkdir -p $out/run/postgresql |
315 |
| - # ''; |
316 |
| - # data = pkgs.runCommand "data" { } '' |
317 |
| - # mkdir -p $out/data/postgresql |
318 |
| - # ''; |
319 |
| - # pgconf = pkgs.runCommand "pgconf" { } '' |
320 |
| - # mkdir -p $out/data/pgconf |
321 |
| - # ''; |
322 |
| - |
323 |
| - # ubuntuFocalAmd64 = nix2img.pullImage { |
324 |
| - # imageName = "ubuntu"; |
325 |
| - # imageDigest = "sha256:b6b83d3c331794420340093eb706a6f152d9c1fa51b262d9bf34594887c2c7ac"; |
326 |
| - # arch = "amd64"; |
327 |
| - # sha256 = "sha256-ugDTb83zbUxVO9IWIv/ukP0z52KiqEM/qSre7ijtBZc="; |
328 |
| - # }; |
329 |
| - |
330 |
| - # ubuntuFocalArm64 = nix2img.pullImage { |
331 |
| - # imageName = "ubuntu"; |
332 |
| - # imageDigest = "sha256:874aca52f79ae5f8258faff03e10ce99ae836f6e7d2df6ecd3da5c1cad3a912b"; |
333 |
| - # arch = "arm64"; |
334 |
| - # sha256 = "sha256-uFypzzRrSw9Yveyp6wVpiiQhrvlqgjI9h+uw0ES6yy0="; |
335 |
| - # }; |
336 |
| - |
337 |
| - # ubuntuFocal = if archString == "amd64" then ubuntuFocalAmd64 else ubuntuFocalArm64; |
338 |
| - # commonVars = builtins.readFile ./common-nix.vars.pkr.hcl; |
339 |
| - |
340 |
| - # # Extract the version using string manipulation |
341 |
| - # amiVersion = builtins.head (builtins.match ".*postgres-version = \"([^\"]*)\".*" commonVars); |
342 |
| - # in |
343 |
| - # nix2img.buildImage { |
344 |
| - # name = "supabase/postgres"; |
345 |
| - # tag = "${amiVersion}-${archString}-base"; |
346 |
| - |
347 |
| - # nixUid = l.toInt uid; |
348 |
| - # nixGid = l.toInt gid; |
349 |
| - # fromImage = ubuntuFocal; |
350 |
| - # copyToRoot = [ |
351 |
| - # (pkgs.buildEnv { |
352 |
| - # name = "image-root"; |
353 |
| - # paths = [ data run pkgs.coreutils pkgs.which pkgs.bash pkgs.nix pkgs.less initScript binPackage pkgs.dockerTools.binSh pkgs.sudo ]; |
354 |
| - # pathsToLink = [ "/bin" "/share" "/lib"]; |
355 |
| - # }) |
356 |
| - # mkUser |
357 |
| - # ]; |
358 |
| - |
359 |
| - # perms = [ |
360 |
| - # { |
361 |
| - # path = data; |
362 |
| - # regex = ""; |
363 |
| - # mode = "0744"; |
364 |
| - # uid = l.toInt uid; |
365 |
| - # gid = l.toInt gid; |
366 |
| - # uname = user; |
367 |
| - # gname = group; |
368 |
| - # } |
369 |
| - # { |
370 |
| - # path = pgconf; |
371 |
| - # regex = ""; |
372 |
| - # mode = "0744"; |
373 |
| - # uid = l.toInt uid; |
374 |
| - # gid = l.toInt gid; |
375 |
| - # uname = user; |
376 |
| - # gname = group; |
377 |
| - # } |
378 |
| - # { |
379 |
| - # path = run; |
380 |
| - # regex = ""; |
381 |
| - # mode = "0744"; |
382 |
| - # uid = l.toInt uid; |
383 |
| - # gid = l.toInt gid; |
384 |
| - # uname = user; |
385 |
| - # gname = group; |
386 |
| - # } |
387 |
| - # ]; |
388 |
| - |
389 |
| - # config = { |
390 |
| - # Entrypoint = [ "/bin/init.sh" ]; |
391 |
| - # User = "root"; |
392 |
| - # WorkingDir = "/var/lib/postgresql/data"; |
393 |
| - # Env = [ |
394 |
| - # "NIX_PAGER=cat" |
395 |
| - # "USER=root" |
396 |
| - # "PGDATA=/data/postgresql" |
397 |
| - # "PGHOST=/run/postgresql" |
398 |
| - # ]; |
399 |
| - # ExposedPorts = { "${pgsqlDefaultPort}/tcp" = { }; }; |
400 |
| - # Volumes = { "/data" = { }; }; |
401 |
| - # }; |
402 |
| - # }; |
403 | 256 |
|
404 | 257 | # Create an attribute set, containing all the relevant packages for a
|
405 | 258 | # PostgreSQL install, wrapped up with a bow on top. There are three
|
|
410 | 263 | # install.
|
411 | 264 | # - exts: an attrset containing all the extensions, mapped to their
|
412 | 265 | # package names.
|
413 |
| - # - docker: a docker image containing the postgresql package, with all |
414 |
| - # the extensions installed, and a receipt.json file containing |
415 |
| - # metadata about the install. |
416 | 266 | makePostgres = version: rec {
|
417 | 267 | bin = makePostgresBin version;
|
418 | 268 | exts = makeOurPostgresPkgsSet version;
|
419 |
| - #docker = makePostgresDocker version bin; |
420 | 269 | recurseForDerivations = true;
|
421 | 270 | };
|
422 | 271 | makeOrioleDbPostgres = version: patchedPostgres: rec {
|
423 | 272 | bin = makeOrioleDbPostgresBin version patchedPostgres;
|
424 | 273 | exts = makeOurOrioleDbPostgresPkgsSet version patchedPostgres;
|
425 |
| - #docker = makePostgresDocker version bin; |
426 | 274 | recurseForDerivations = true;
|
427 | 275 | };
|
428 | 276 |
|
|
0 commit comments