Compare commits

...

2 Commits

Author SHA1 Message Date
Ricard Illa ef8441db26
nix shell added 2023-01-08 17:42:17 +01:00
Ricard Illa 069a9cd05d
started migration to podman 2023-01-08 17:40:17 +01:00
7 changed files with 93 additions and 15 deletions

4
.envrc Normal file
View File

@ -0,0 +1,4 @@
if ! has nix_direnv_version || ! nix_direnv_version 2.2.0; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.0/direnvrc" "sha256-5EwyKnkJNQeXrRkYbwwRBcXbibosCJqyIUuz9Xq+LRc="
fi
use flake

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ gitolite/.env
ansible/.env
ansible/known_hosts
*/out/image-name
.direnv

View File

@ -35,3 +35,9 @@ docker buildx create --use
```sh
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
```
or
```sh
sudo podman run --rm --privileged multiarch/qemu-user-static --reset -p yes
```

43
flake.lock Normal file
View File

@ -0,0 +1,43 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1673027386,
"narHash": "sha256-Wjt+oDhRLcf3opIjUKHGN+Xrp3w2ZDms6bO4pCLvsco=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b3818a46e686f24561a28eaa9fcf35e18b8d8e89",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

15
flake.nix Normal file
View File

@ -0,0 +1,15 @@
{
description = "A basic flake with a shell";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
nativeBuildInputs = [ pkgs.podman pkgs.buildah pkgs.skopeo ];
buildInputs = [ ];
};
});
}

View File

@ -1,4 +1,4 @@
FROM alpine:3.16
FROM alpine:3.17
RUN mkdir -p /var/lib/mpd && \
addgroup --gid 10001 mpd && \

View File

@ -1,19 +1,28 @@
IMG_NAME = mpd
REGISTRY=registry.monotremata.xyz
IMG=$(REGISTRY)/$(IMG_NAME)
PLATFORMS=linux/arm64
REGISTRY = registry.monotremata.xyz
IMG = $(REGISTRY)/$(IMG_NAME)
PLATFORM = linux/amd64,linux/arm64
JOBS = 1
.PHONY: build push buildx
.PHONY: build push
build: Dockerfile
docker build -t $(IMG) .
push: build
docker image push $(IMG)
out/image-name: Dockerfile
mkdir -p $(@D)
buildah build \
--jobs=$(JOBS) \
--platform=$(PLATFORM) \
--manifest=$(IMG) .
@echo $(IMG) > $(@)
buildx: Dockerfile
docker buildx build \
--platform $(PLATFORMS) \
--tag $(IMG) \
--push \
.
#out/image-name: Dockerfile
# mkdir -p $(@D)
# podman build \
# --manifest $(ING) \
# --platform linux/amd64 \
# --platform linux/arm64 \
# .
# @echo $(IMG) > $(@)
push: out/image-name
podman manifest push --all $(IMG) docker://$(IMG)