nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitHub,
4 buildGoModule,
5 go-md2man,
6 installShellFiles,
7 pkg-config,
8 which,
9 libapparmor,
10 libseccomp,
11 libselinux,
12 stdenv,
13 makeBinaryWrapper,
14 nixosTests,
15}:
16
17buildGoModule (finalAttrs: {
18 pname = "runc";
19 version = "1.4.0";
20
21 src = fetchFromGitHub {
22 owner = "opencontainers";
23 repo = "runc";
24 tag = "v${finalAttrs.version}";
25 hash = "sha256-XPS9qWgDyKVLYs/QqWof6ydVK1T41QD8yDpvztc3NMc=";
26 };
27
28 vendorHash = null;
29 outputs = [
30 "out"
31 "man"
32 ];
33
34 nativeBuildInputs = [
35 go-md2man
36 installShellFiles
37 makeBinaryWrapper
38 pkg-config
39 which
40 ];
41
42 buildInputs = [
43 libselinux
44 libseccomp
45 libapparmor
46 ];
47
48 makeFlags = [
49 "BUILDTAGS+=seccomp"
50 "SHELL=${stdenv.shell}"
51 ];
52
53 buildPhase = ''
54 runHook preBuild
55 patchShebangs .
56 make ${toString finalAttrs.makeFlags} runc man
57 runHook postBuild
58 '';
59
60 installPhase = ''
61 runHook preInstall
62 install -Dm755 runc $out/bin/runc
63 installManPage man/*/*.[1-9]
64 wrapProgram $out/bin/runc \
65 --prefix PATH : /run/current-system/systemd/bin
66 runHook postInstall
67 '';
68
69 passthru.tests = { inherit (nixosTests) cri-o docker podman; };
70
71 meta = {
72 homepage = "https://github.com/opencontainers/runc";
73 description = "CLI tool for spawning and running containers according to the OCI specification";
74 license = lib.licenses.asl20;
75 maintainers = with lib.maintainers; [ offline ];
76 teams = [ lib.teams.podman ];
77 platforms = lib.platforms.linux;
78 mainProgram = "runc";
79 };
80})