diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-07-18 08:29:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-18 08:29:16 -0400 |
commit | d087adeb8716b7214ee925df749a34c8b3b01f4e (patch) | |
tree | cf129e24ec938424740c275226b7d3b2d60de9da /Makefile | |
parent | deff289a9fea26815983318b0a120ab652295eb8 (diff) | |
parent | f53812a11ebfcb7ccb46df998147048e8f2a27a3 (diff) | |
download | podman-d087adeb8716b7214ee925df749a34c8b3b01f4e.tar.gz podman-d087adeb8716b7214ee925df749a34c8b3b01f4e.tar.bz2 podman-d087adeb8716b7214ee925df749a34c8b3b01f4e.zip |
Merge pull request #6402 from alvistack/master-linux-amd64
[nix] Cleanup nix derivation for static builds
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 27 |
1 files changed, 8 insertions, 19 deletions
@@ -220,29 +220,18 @@ bin/podman.cross.%: .gopathok GOARCH="$${TARGET##*.}" \ $(GO_BUILD) -gcflags '$(GCFLAGS)' -asmflags '$(ASMFLAGS)' -ldflags '$(LDFLAGS_PODMAN)' -tags '$(BUILDTAGS_CROSS)' -o "$@" $(PROJECT)/cmd/podman -# Update nix/nixpkgs.json its latest master commit +# Update nix/nixpkgs.json its latest stable commit .PHONY: nixpkgs nixpkgs: - @nix run -f channel:nixpkgs-unstable nix-prefetch-git -c nix-prefetch-git \ + @nix run -f channel:nixos-20.03 nix-prefetch-git -c nix-prefetch-git \ --no-deepClone https://github.com/nixos/nixpkgs > nix/nixpkgs.json -NIX_IMAGE ?= quay.io/podman/nix-podman:1.0.0 - -# Build the nix image as base for static builds -.PHONY: nix-image -nix-image: - $(CONTAINER_RUNTIME) build -t $(NIX_IMAGE) -f Containerfile-nix . - -# Build podman statically linked based on the default nix container image -.PHONY: build-static -build-static: - $(CONTAINER_RUNTIME) run \ - --rm -it \ - -v $(shell pwd):/work \ - -w /work $(NIX_IMAGE) \ - sh -c "nix build -f nix && \ - mkdir -p bin && \ - cp result-*bin/bin/podman bin/podman-static" +# Build statically linked binary +.PHONY: static +static: + @nix build -f nix/ + mkdir -p ./bin + cp -rfp ./result/bin/* ./bin/ .PHONY: run-docker-py-tests run-docker-py-tests: |