From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id mGQDKGT0PmSQ8gAASxT56A (envelope-from ) for ; Tue, 18 Apr 2023 21:49:56 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id QAYpJ2T0PmRq3gAAG6o9tA (envelope-from ) for ; Tue, 18 Apr 2023 21:49:56 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2DE5D17DA6 for ; Tue, 18 Apr 2023 21:49:56 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1porKT-0003dx-7P; Tue, 18 Apr 2023 15:49:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1porKQ-0003dK-Qy for help-guix@gnu.org; Tue, 18 Apr 2023 15:49:26 -0400 Received: from minsky.hcoop.net ([104.248.1.95]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1porKP-0008OY-9X for help-guix@gnu.org; Tue, 18 Apr 2023 15:49:26 -0400 Received: from marsh.hcoop.net ([45.55.52.66]) by minsky.hcoop.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1porKN-0000rG-DL for help-guix@gnu.org; Tue, 18 Apr 2023 15:49:23 -0400 Date: Tue, 18 Apr 2023 15:49:23 -0400 (EDT) From: Jack Hill X-X-Sender: jackhill@marsh.hcoop.net To: help-guix@gnu.org Subject: Docker image format with services Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Received-SPF: pass client-ip=104.248.1.95; envelope-from=jackhill@jackhill.us; helo=minsky.hcoop.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action Content-Type: text/plain; format=flowed; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1681847396; a=rsa-sha256; cv=none; b=jFxwo6YdmRbVot26jQdwGdJfVxj9WgD1yTX4aqRkczB8NDX6tQ2Bh0C2E4FP7cFzAC+hY/ 0XR7lZqqau8j9lmJdwLEobDn/nq2X8GBSHe7zFpyhriL6Ls6AAv/yNrQvoKGkAS6XQEgui xze8spyXs6RMJlGKJh8YXHeQm8odgWuf8iUYQxgtJnJ3U3T/lNawsLgszjDiWnIz8+JA8i UOgQskOyKDg85vAYdRRpXXMBsopFsdJnjQnxsx8RIp+NIJ6MTnrSmQkQAXiu2A6NW7EOWi Q8mtCcY6rVeHrS+R4+UYYuwwnT8qI8s8SDvoCmzV0jkTsq5cQnjayjbAeQoapg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681847396; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=LzzmeijsBw3IGTakD/11bKD31O6zRkQqoRrlrdfDHrY=; b=gb4EkpH4gOTHYV0H4b3OxrIZ24vrNwAUuE06NrH8e6OKqXe+bzEqKLeIJ/nqGbp3qrF/yJ icnygplTYwUQe0xQO65ydwPP6hE+oxgRoFlDVn/P7fbnrtYAv2UCU2IVjOSo8+CpfH8zw4 vRYVA+RBdUbWIcjsEC08L4O2keyOsg98BxOLIB0AZU28yW3up/nCglCw79bPwtKVXj+enr s8/dRnr9SMHZdBBxfH9ENDpw1m2cj+f2xS4qB5r/e3pYGTRg1BWYky3oM0iUkr7jaRCBNM vaEE+OL9ueTiuV3byjrnVgmxGsUL0gsdIAe5icmsIZA5sLfh4oJ3lpFAyA9VFQ== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -1.01 X-Spam-Score: -1.01 X-Migadu-Queue-Id: 2DE5D17DA6 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-TUID: XXlbTaRkkDgE Hi Guix, I have a need to build some Docker images (well, really OCI-compliant images) to run some service on computing systems that I don't manage. I thought I would use `guix system image` to build these images. In order to get a feel for it, I'm testing it out with the docker service running on my Guix System (commit 50dd91bc30634c75c0001cfd38bbcc2fbbeb894e). So far, I've created an image from this file with `guix system image filename.scm`: ``` (use-modules (gnu) (gnu image) (gnu system image)) (use-service-modules databases ssh) (use-package-modules databases linux) (define container-os (operating-system (host-name "container") (timezone "America/New_York") (kernel linux-libre) (bootloader (bootloader-configuration (bootloader grub-efi-bootloader) (targets '("/dev/sdX")))) (file-systems '()) (packages %base-packages) (users (cons* (user-account (name "jackhill") (comment "Jack Hill") (group "users") (supplementary-groups '("wheel" ))) %base-user-accounts)) (services (cons* (service openssh-service-type (openssh-configuration (port-number 2222) (password-authentication? #f) (authorized-keys `(("jackhill" ,(local-file "/home/jackhill/.ssh/id_ed25519.pub")))))) (service postgresql-service-type (postgresql-configuration (postgresql postgresql-14) (config-file (postgresql-config-file (log-destination "stderr") (hba-file (plain-file "pg_hba.conf" " local all all trust host all all 172.17.0.1/32 trust")) (extra-config '(("listen_addresses" "*") ("log_directory" "/var/log/postgresql"))))))) (service postgresql-role-service-type (postgresql-role-configuration (roles (list (postgresql-role (name "test") (create-database? #t)))))) %base-services)))) (define container-image (image (format 'docker) (operating-system container-os) (shared-network? #t))) container-image ``` I then load that into docker: `docker load < /gnu/store/…tar.gz`, and run it with `docker run guix`. So far, so good. However, ssh-daemon and postgres don't start. If I then get a shell in the running container with `docker exec -ti … /bin/sh`, I can see that `herd status` reports that those services are stopped. Trying to start either service fails: ``` sh-5.1# herd start ssh-daemon herd: exception caught while executing 'start' on service 'loopback': Throw to key `%exception' with args `("#<&netlink-response-error errno: 1>")'. sh-5.1# herd start postgres herd: exception caught while executing 'start' on service 'loopback': Throw to key `%exception' with args `("#<&netlink-response-error errno: 1>")'. ``` What's going on here? Is this a disagreement between shepherd and docker about who's in charge of the networking? What's the right way to create a docker system image that can run services? Or, alternatively, is system image the way to go here? I haven't yet explored running these services from a `guix pack` produced image, but I suppose that could work as well? Thanks! Jack