You probably can’t build a container without swap. You could try creating the swap, building the container, shutting down the container, and removing the swap.
You’re really on your own with this. I would advise highly against trying to circumvent the SWAP requirement. You should contact your cloud provider to provision a larger disk for you.
I tried the next best thing with two SSH windows. create swap, run launcher, other ssh window delete swap, launcher continued. And this might work on a better provisioned VPS. On my next spare I will try it. I have an instance now running on 4c12r
Typically you need more memory (RAM+swap) for an update than you do for normal service.
If you have no space for swap, it’s because your forum data (database+uploads) is using the space you need.
It’s just possible that you could follow the strategy
never update
or the strategy
migrate your data each time to a fresh up to date installation
But I’ve done my own struggling with a minimal sized instance, using my many decades of sysadmin experience. Eventually, it was preferable to use a bigger machine. In fact, very preferable, because the bigger machine was cheaper. This is because different providers charge different amounts - I moved from Digital Ocean to Hetzner.
The other possibility, which would require a bunch of work, would be to build the new image on another machine, put it to some repo, and then launch it on the low-resource machine.
But that’s beyond the kind of help it’s feasible to provide on a forum.