File tree Expand file tree Collapse file tree 3 files changed +12
-24
lines changed
Expand file tree Collapse file tree 3 files changed +12
-24
lines changed Original file line number Diff line number Diff line change 1515 fetch-depth : 0
1616 - uses : DeterminateSystems/nix-installer-action@main
1717 - uses : DeterminateSystems/flakehub-cache-action@main
18- - name : Build and load image
19- run : docker load <$(nix build --extra-experimental-features "nix-command flakes" --print-out-paths --no-link .#packages.x86_64-linux.docker)
18+ - name : Build binary
19+ run : nix build --extra-experimental-features "nix-command flakes" .#packages.x86_64-linux.webdavplugin
20+ - name : Build docker image
21+ run : docker build -t $IMAGE_NAME .
2022 - name : Log in to registry
2123 run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
2224 - name : Push image
Original file line number Diff line number Diff line change 1+ FROM debian:bullseye
2+
3+ ARG binary=./result/bin/webdav
4+ COPY ${binary} /webdav
5+
6+ RUN apt update && apt install -y davfs2
7+
8+ ENTRYPOINT ["/webdav" ]
Original file line number Diff line number Diff line change 2828 webdavplugin = callPackage ./. {
2929 inherit ( gomod2nix . legacyPackages . ${ system } ) buildGoApplication ;
3030 } ;
31-
32- docker = pkgs . dockerTools . buildImage {
33- name = "webdavplugin" ;
34- tag = "latest" ;
35- contents = pkgs . buildEnv {
36- name = "image-root" ;
37- paths = with pkgs ; [
38- mount
39- davfs2
40- ] ;
41- } ;
42- # https://nixos.org/manual/nixpkgs/stable/#ssec-pkgs-dockerTools-shadowSetup
43- runAsRoot = ''
44- ${ pkgs . dockerTools . shadowSetup }
45- groupadd -r davfs2
46- useradd -r -g davfs2 davfs2
47- ln -s /proc/mounts /etc/mtab # davfs2 needs this
48- mkdir -p /var/cache/davfs2
49- chmod 0600 /etc/davfs2/secrets # reset permissions
50- '' ;
51- config . Entrypoint = [ "${ webdavplugin } /bin/webdav" ] ;
52- } ;
5331 } ;
5432 devShells . default = callPackage ./shell.nix {
5533 inherit ( gomod2nix . legacyPackages . ${ system } ) mkGoEnv gomod2nix ;
You can’t perform that action at this time.
0 commit comments