From 096b14a28812be788824042eed3116e3b664025d Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar <3998+srid@users.noreply.github.com> Date: Sun, 10 Mar 2024 09:31:02 -0400 Subject: [PATCH] Remove docker support (#524) Docker buids have been breaking a lot, and I don't want to spend my valuable time supporting Docker, when Nix is a superior solution anyway. --- .github/workflows/ci.yaml | 40 ------------------------------------ docs/start/install.md | 12 +---------- docs/start/install/docker.md | 18 ---------------- flake.nix | 1 - justfile | 2 +- nix/docker.nix | 37 --------------------------------- 6 files changed, 2 insertions(+), 108 deletions(-) delete mode 100644 docs/start/install/docker.md delete mode 100644 nix/docker.nix diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 82b1db63a..f6afa23c4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -48,43 +48,3 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs-static cname: emanote.srid.ca - - docker-build: - runs-on: self-hosted - steps: - - uses: actions/checkout@v4 - - name: Build as docker img - id: build - run: | - nix build -j auto -o docker-img .#packages.x86_64-linux.dockerImage - # docker - export DOCKERIMG=$(readlink ./docker-img) - echo "::set-output name=docker-img::${DOCKERIMG}" - - name: Upload docker image tgz - uses: actions/upload-artifact@v4 - if: github.ref == 'refs/heads/master' - with: - name: docker-img - retention-days: 1 - path: | - ${{ steps.build.outputs.docker-img }} - - docker-push: - needs: docker-build - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/master' - env: - DOCKERTAG: latest - steps: - - name: Download docker img - uses: actions/download-artifact@v4 - with: - name: docker-img - - name: Load Docker img - run: | - docker load -i *docker-image-emanote.tar.gz - - name: Publish Docker image to Docker Hub - run: | - echo ${{ secrets.DOCKER_PASS }} | docker login -u sridca --password-stdin - set -x - docker push sridca/emanote:latest diff --git a/docs/start/install.md b/docs/start/install.md index 26094b3ec..f22dc3489 100644 --- a/docs/start/install.md +++ b/docs/start/install.md @@ -12,7 +12,7 @@ order: 1 Emanote is supported on all popular operating systems through [Nix]. If you are new to Nix, checkout [this tutorial](https://nixos.asia/en/nix-first). 1. [Install Nix & enable Flakes](https://nixos.asia/en/install) - 1. For Windows, see [[wsl]] or [the Docker approach](https://github.com/srid/emanote/issues/230) + 1. For Windows, see [[wsl]] 1. For NixOS, see [[nix]] 2. Run `nix profile install github:srid/emanote` to install Emanote @@ -32,13 +32,3 @@ emanote -L /path/to/notebook gen /tmp/output ``` [Nix]: https://nixos.asia/en/nix - -## Non-nix methods - -If you do not wish to use Nix, you may use Emanote in one of the following ways: - -| Method | Long-term support | Platforms | -| ---------- | ----------------- | ----------------- | -| [[docker]] | Guaranteed | Linux, WSL, macOS | - -Nix and [[docker]] are the only mechanisms the author intends to support in the long-term. diff --git a/docs/start/install/docker.md b/docs/start/install/docker.md deleted file mode 100644 index fad950248..000000000 --- a/docs/start/install/docker.md +++ /dev/null @@ -1,18 +0,0 @@ -# Docker image - -The official Docker image, which is built in CI, can be used as follows: - -```bash -cd /path/to/notebook -mkdir output.docker -docker run \ - -e LANG=C.UTF-8 -e LC_ALL=C.UTF-8 \ - --tmpfs /tmp \ - -v $PWD:/data \ - sridca/emanote emanote -L "/data" gen /data/output.docker -open ./output.docker/index.html -``` - -## Links - -- https://hub.docker.com/r/sridca/emanote diff --git a/flake.nix b/flake.nix index 6a848db91..ff8488778 100644 --- a/flake.nix +++ b/flake.nix @@ -42,7 +42,6 @@ inputs.flake-root.flakeModule inputs.treefmt-nix.flakeModule ./nix/flake-module.nix - ./nix/docker.nix ]; perSystem = { pkgs, lib, config, system, ... }: { diff --git a/justfile b/justfile index 9f0df8f97..b090d4ad1 100644 --- a/justfile +++ b/justfile @@ -1,4 +1,4 @@ -notebook := "../docs" +notebook := "../docs;/Users/srid/code/nixos-asia-website/en@asia" default: @just --list diff --git a/nix/docker.nix b/nix/docker.nix deleted file mode 100644 index 9600340b7..000000000 --- a/nix/docker.nix +++ /dev/null @@ -1,37 +0,0 @@ -# Add a package for docker image on Linux. -{ ... }: - -{ - config = { - perSystem = { config, self', inputs', pkgs, system, ... }: { - packages = pkgs.lib.optionalAttrs (system == "x86_64-linux" || system == "aarch64-linux") - { - dockerImage = pkgs.dockerTools.buildImage - { - name = "sridca/emanote"; - tag = "latest"; - copyToRoot = pkgs.buildEnv { - name = "image-root"; - paths = [ - self'.packages.default - # These are required for the GitLab CI runner - pkgs.coreutils - pkgs.bash_5 - ]; - pathsToLink = [ "/bin" ]; - }; - config = { - WorkingDir = "/data"; - Volumes = { - "/data" = { }; - }; - Tmpfs = { - "/tmp" = { }; - }; - Cmd = [ "${pkgs.lib.getExe self'.packages.default}" ]; - }; - }; - }; - }; - }; -}