From patchwork Wed May 1 06:27:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell Currey X-Patchwork-Id: 1093604 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44v7kL3k4zz9s9N for ; Wed, 1 May 2019 16:28:10 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=russell.cc Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=russell.cc header.i=@russell.cc header.b="HJ9+IbO9"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="5yhRDJf/"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 44v7kL1SllzDqT4 for ; Wed, 1 May 2019 16:28:10 +1000 (AEST) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=russell.cc (client-ip=64.147.123.24; helo=wout1-smtp.messagingengine.com; envelope-from=ruscur@russell.cc; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=russell.cc Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=russell.cc header.i=@russell.cc header.b="HJ9+IbO9"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="5yhRDJf/"; dkim-atps=neutral Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 44v7jx1808zDq9Z for ; Wed, 1 May 2019 16:27:48 +1000 (AEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 411F04AA; Wed, 1 May 2019 02:27:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 01 May 2019 02:27:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=russell.cc; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm1; bh=/PGxcY8u8n9bHOZIdEXTFpp7C7 ueZsyEoKI7Nfv22tA=; b=HJ9+IbO9FJzMRjY9G7qTJce6Otlv7QCH5ch2FNh2v/ Y9BwmA6I4nHUAjUlZmhoEsYFL8bwJx6LGhzCGdINHdWtuU612Shl9k3dZ7924oWw MUgWo8sxzKAtCCijBEa0FkkwqXtq7nOXdxfKCLVy8gWgyajVbTLWzqlKr1A0HucB S2s34jYdnBRe5aq4xM+su/QxW/HxvekRvXYXa4jbF5f65dS2ZvbtWCj0jrE090XU VBWqDWDdHPznbZR2hJI/p44VbwJpAkEo7qboqKcW5xU1OQVYlynqlglVWyo7VRHl WR1xQv/RwSmyYTtSLGcFp5tFTRP8/jfS7AsILClhDXLw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=/PGxcY8u8n9bHOZId EXTFpp7C7ueZsyEoKI7Nfv22tA=; b=5yhRDJf//Mo1JW1BvX2CPggq3O7POURD0 okUXO14ev30Cv3TEr1a64n9gxWvRpZgl5qvOOuuN8v9ypJ811EEte4HeDmRaZRab 28vmlmN6OkLJnW5B+154BypqaaMH9NkrlzsQ5+Yo19+VNiDxXaHoYZXJCy86VUBW r2OjDIYKC21/TXKQ8g1JTONNI5Qna6AjE/V/gLVIRgtUjyUovDyprq3w+KjhQpl5 3A7U9VXpRyWw1DJhaP+Du/cJimYKhUhBTjfjIePKcBo1+leuBasYWCmgd5cLaFHC nx28GMa9AXDt+TTn8zsbZ9l01ZA4OpU4SjfITjOWiLv6J50tv3hXg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrieeigdduuddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdludehmdenucfjughrpefhvf fufffkofgggfestdekredtredttdenucfhrhhomheptfhushhsvghllhcuvehurhhrvgih uceorhhushgtuhhrsehruhhsshgvlhhlrdgttgeqnecuffhomhgrihhnpehusghunhhtuh drtghomhdpshgvthhtihhnghhsrdguvghvnecukfhppeduvddvrdelledrkedvrddutden ucfrrghrrghmpehmrghilhhfrhhomheprhhushgtuhhrsehruhhsshgvlhhlrdgttgenuc evlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from crackle.ozlabs.ibm.com (unknown [122.99.82.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 37971E407B; Wed, 1 May 2019 02:27:42 -0400 (EDT) From: Russell Currey To: patchwork@lists.ozlabs.org Subject: [PATCH 1/2] docker: Use Ubuntu ports repositories on non-x86 architectures Date: Wed, 1 May 2019 16:27:17 +1000 Message-Id: <20190501062718.17548-1-ruscur@russell.cc> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" This should allow Patchwork to run "out of the box" in Docker on any architecture with a) an Ubuntu port and b) support in the Postgres multiarch Docker image, which includes at least arm64 and ppc64le. It's a little gross hacking the Dockerfile like this, but I'm not sure there's a more elegant way to do it. Unfortunately it doesn't seem like there's any way to do conditional COPY, and anything in RUN is plain /bin/sh, so that's why it looks like it does. Tested on ppc64le and on x86_64. Signed-off-by: Russell Currey Reviewed-by: Andrew Donnellan --- tools/docker/Dockerfile | 14 ++++++++++++-- tools/docker/trusty-ports.list | 3 +++ tools/docker/xenial-ports.list | 3 +++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 tools/docker/trusty-ports.list create mode 100644 tools/docker/xenial-ports.list diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index eef40e4..76bb6b2 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -15,11 +15,21 @@ ENV DJANGO_SETTINGS_MODULE patchwork.settings.dev ENV DEBIAN_FRONTEND noninteractive ENV PYTHONUNBUFFERED 1 + # System # trusty and findutils is for python3.4; xenial is for python3.5 # TODO(stephenfin): Are curl, unzip required? -COPY tools/docker/trusty.list /etc/apt/sources.list.d/trusty.list -COPY tools/docker/xenial.list /etc/apt/sources.list.d/xenial.list +COPY tools/docker/*.list /etc/apt/sources.list.d/ + +RUN cd /etc/apt/sources.list.d; \ + echo $(uname -m) > /tmp/arch; \ + if [ $(cat /tmp/arch) != 'x86_64' ] && grep -q -v "i.86" /tmp/arch; then \ + mv trusty-ports.list trusty.list; \ + mv xenial-ports.list xenial.list; \ + else \ + rm *-ports.list; \ + fi + RUN apt-get update -qq && \ apt-get install -y --no-install-recommends --allow-downgrades \ python-dev python-pip python-setuptools python-wheel \ diff --git a/tools/docker/trusty-ports.list b/tools/docker/trusty-ports.list new file mode 100644 index 0000000..ebcf4fa --- /dev/null +++ b/tools/docker/trusty-ports.list @@ -0,0 +1,3 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ trusty main +deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main +deb http://ports.ubuntu.com/ubuntu-ports/ trusty-security main diff --git a/tools/docker/xenial-ports.list b/tools/docker/xenial-ports.list new file mode 100644 index 0000000..d84641f --- /dev/null +++ b/tools/docker/xenial-ports.list @@ -0,0 +1,3 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ xenial main +deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main +deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main