diff --git a/Makefile b/Makefile index 9f02e6e..974f35a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .DEFAULT_GOAL := default -IMAGE ?= docker.cloud.cluster.fun/averagemarcus/blog:latest +IMAGE ?= docker.cluster.fun/averagemarcus/blog:latest .PHONY: test # Run all tests, linting and format checks test: lint check-format run-tests diff --git a/app.js b/app.js index f0223b9..083aa8b 100644 --- a/app.js +++ b/app.js @@ -23,18 +23,30 @@ const striptags = require('striptags'); const port = process.env.PORT || 8000; +app.disable('x-powered-by'); app.use(compress()); app.use(express.static(__dirname + '/build')); // Lets try and slow down some of those exploit crawlers app.use("/", require('./filterRoutes')); +// Handle some iOS icon 404s +app.get("/apple-touch-icon*", function(req, res) { + res.sendFile(__dirname + '/build/images/favico/' + req.url, () => { + res.sendFile(__dirname + '/build/images/favico/apple-touch-icon.png'); + }); +}); + +app.get("/favicon.png", function(req, res) { + res.sendFile(__dirname + '/build/images/favico/apple-touch-icon.png'); +}); + app.get("/robots.txt", function(req, res) { res.send("User-agent: * Disallow: "); }) -app.get(/\/(feed|rss)\/?$/, function(req, res) { - res.redirect('/feed.xml'); +app.get(/(\/(feeds?|rss|atom)\/?|feed.xml|rss.xml|index.rss|feed.rss)$/, function(req, res) { + res.redirect(301, '/feed.xml'); }) app.get("/healthz", function(req, res) { diff --git a/src/images/favico/apple-touch-icon-precomposed.png b/src/images/favico/apple-touch-icon-precomposed.png new file mode 100644 index 0000000..0b7df6e Binary files /dev/null and b/src/images/favico/apple-touch-icon-precomposed.png differ diff --git a/src/images/favico/apple-touch-icon.png b/src/images/favico/apple-touch-icon.png new file mode 100644 index 0000000..0b7df6e Binary files /dev/null and b/src/images/favico/apple-touch-icon.png differ diff --git a/src/images/podman-macos.png b/src/images/podman-macos.png new file mode 100644 index 0000000..b646702 Binary files /dev/null and b/src/images/podman-macos.png differ diff --git a/src/posts/2021-09-01-migrating-from-docker-to-podman.md b/src/posts/2021-09-01-migrating-from-docker-to-podman.md index c2144f4..7a93926 100644 --- a/src/posts/2021-09-01-migrating-from-docker-to-podman.md +++ b/src/posts/2021-09-01-migrating-from-docker-to-podman.md @@ -14,13 +14,22 @@ There has been quite a bit of reaction to this news..." 2021-09-01: Added note about socket bugfix PR 2021-09-01: Added troubleshooting section about port forwarding bug + +2021-09-04: Added note about switching to Podman on Windows + +2021-09-04: Added update about port forwarding PR + +2021-09-04: Added note about M1 Mac support + +2021-09-04: Added volume mount limitation + +2021-09-04: Added podman-macos utility Docker has [recently announced](https://www.docker.com/blog/updating-product-subscriptions/) that Docker Desktop will soon require a subscription and, based on the size of your company, may require a paid subscription. (It remains free for personal use) There has been quite a bit of reaction to this news: -
[![](https://tweet.cluster.fun/1432720164169076755)](https://twitter.com/QuinnyPig/status/1432720164169076755) @@ -28,7 +37,6 @@ There has been quite a bit of reaction to this news:
Corey isn't too impressed with the news
-
[![](https://tweet.cluster.fun/1432974196632604676)](https://twitter.com/manuel_zapf/status/1432974196632604676) @@ -38,7 +46,6 @@ There has been quite a bit of reaction to this news: Depending on which side your opinions lie, you might be looking for alternatives. Well it just so happens that [Podman](https://podman.io) posted this well-timed tweet: -
[![](https://tweet.cluster.fun/1432800271873323010)](https://twitter.com/Podman_io/status/1432800271873323010) @@ -50,6 +57,8 @@ So, lets give it a whirl... ## Replacing Docker with Podman (on Mac) +> Note: This currently doesn't work for Macs with an M1 CPU. I've come across this post in my search - [Running Podman Machine on the Mac M1](https://www.cloudassembler.com/post/podman-machine-mac-m1/) - but I've not confirmed if it works or not. + 1. `brew install podman` 2. Wait while brew downloads, builds and installs... 3. Create a virtual machine for Podman to run from: @@ -80,6 +89,10 @@ So, lets give it a whirl... 5. `alias docker=podman` (Add this to your `.bashrc` (if using Bash), `.zshrc` (if using ZSH) or whatever the correct file for your shell is) 6. 🎉 +## Replacing Docker with Podman (on Windows) + +I don't currently have access to a Windows machine where I can test this out but [Frank](https://twitter.com/frank_k_p) sent me this [on Twitter](https://twitter.com/frank_k_p/status/1433490007088668672) that covers the process needed for those on Windows with WLS2 - [How to run Podman on Windows with WSL2](https://www.redhat.com/sysadmin/podman-windows-wsl2). + ## Troubleshooting Ok, so it's not all *completely* pain free, there are a few issues you might hit... @@ -104,6 +117,19 @@ This seems to happen (for me at least) when I've previously run `podman machine > UPDATE: Looks like this will be fixed in an upcoming release. - [PR](https://github.com/containers/podman/pull/11342) +### Volume mounts + +```sh +✨ podman run --rm -it -v $(pwd):/usr/share/nginx/html:ro --publish 8000:80 docker.io/library/nginx:latest +Error: statfs /Users/marcus/web: no such file or directory +``` + +Podman machine currently has no support for mounting volumes from the host machine (your Mac) into the container on the virtual machine. Instead, it attepts to mount a directory matching what you specified from the _virtual machine_ rather than your Mac. + +This is a fairly big issue if you're looking for a smooth transition from Docker Desktop. + +There's currently a fairly active [issue](https://github.com/containers/podman/issues/8016) about this limitation but as of right now there doesn't seem to be a nice workaround or solution. + ### Automatic published port forwarding ```sh @@ -125,7 +151,7 @@ The first is passing in the `--network bridge` flag to the podman command, e.g. The other, more perminant option is to add `rootless_networking = "cni"` under the `[containers]` section of your `~/.config/containers/containers.conf` file. -To follow the progress of this bug, please refer to the [issue](https://github.com/containers/podman/issues/11396). +To follow the progress of this bug, please refer to the [issue](https://github.com/containers/podman/issues/11396). **UPDATE**: This has now been merged and is expected to be released in v3.3.2 in the next few days or so. ## short-name resolution @@ -192,6 +218,17 @@ This property contains a list of all the registries that will be checked (in ord With that change made we can `exit` from the virtual machine and Podman should then search for any short name images using these registries from now on. +## GUI Replacement + +For those that like to have a graphical UI to manage / monitor their running containers [Victor](https://github.com/heyvito) has released [podman-macos](https://github.com/heyvito/podman-macos) that provides a tiny taskbar utility for Podman. + +
+ +![](/images/podman-macos.png) + +
Podman GUI for MacOS
+
+ ## Wrap Up I'm sure there's many more inconsistencies but so far I'm pretty impressed. I'm plan to try using Podman instead of Docker for a while and see how I get on. I'll try and update this post with anything more I find out. diff --git a/templates/index.html b/templates/index.html index 83056cc..f835534 100644 --- a/templates/index.html +++ b/templates/index.html @@ -14,7 +14,7 @@
  • diff --git a/templates/partials/head.html b/templates/partials/head.html index 966ff36..81de46b 100644 --- a/templates/partials/head.html +++ b/templates/partials/head.html @@ -18,6 +18,7 @@ + diff --git a/templates/post.html b/templates/post.html index 4903d68..ecd64f8 100644 --- a/templates/post.html +++ b/templates/post.html @@ -8,7 +8,7 @@