Blog: 2023-08-13: Difference between revisions
(Created page with "Trying to get asdf working in docker, this example is useful to get rid of all the hacks: https://github.com/asdf-community/asdf-ubuntu") |
No edit summary |
||
(5 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
https://github.com/asdf-community/asdf-ubuntu |
https://github.com/asdf-community/asdf-ubuntu |
||
Also trying to get podman to run faster, podman info gives storage of vfs. Apparently overlayfs is faster, so I set it like so:<syntaxhighlight lang="bash"> |
|||
functions $ cat ~/.config/containers/storage.conf |
|||
[storage] |
|||
driver = "overlay" |
|||
</syntaxhighlight>https://docs.oracle.com/en/operating-systems/oracle-linux/podman/podman-ConfiguringStorageforPodman.html#configuring-podman-storage |
|||
And then I had to <code>podman system reset</code>. |
|||
Wow with this change using cached images is instantaneous! Hooray! |
|||
Also I'm passing <code>--network host</code>. Not sure if that's doing anything. |
|||
Github actions for weave are stuck in queue, no surprise for a free service. Would like to run them locally, perhaps using <code>act</code>: https://github.com/nektos/act |
|||
Should incorporate this into the readme somehow, but to run the python server from a podman container the command is: |
|||
<code>docker run -i -t -p 5000:5000 (last-image-built) pipenv run gunicorn server:app -b :5000</code> |
|||
Ok I have that command as part of a makefile. The workflow isn't totally smooth since this rebuilds the frontend which takes about 15 seconds; ideally the dev server would start in the container with some sort of port mapping... but here's the makefile.<syntaxhighlight lang="makefile"> |
|||
.PHONY: run |
|||
all: |
|||
podman build . |
|||
run: |
|||
export IMAGE_ID=$(shell podman images --format "{{.ID}} {{.CreatedAt}}" | sort -rk 2 | head -1 | cut -d ' ' -f 1); \ |
|||
docker run -i -t -p 5000:5000 $$IMAGE_ID pipenv run gunicorn server:app -b :5000 |
|||
</syntaxhighlight>usage: |
|||
<code>make</code> |
|||
<code>make run</code> |
Latest revision as of 23:31, 12 August 2023
Trying to get asdf working in docker, this example is useful to get rid of all the hacks:
https://github.com/asdf-community/asdf-ubuntu
Also trying to get podman to run faster, podman info gives storage of vfs. Apparently overlayfs is faster, so I set it like so:
functions $ cat ~/.config/containers/storage.conf
[storage]
driver = "overlay"
And then I had to podman system reset
.
Wow with this change using cached images is instantaneous! Hooray!
Also I'm passing --network host
. Not sure if that's doing anything.
Github actions for weave are stuck in queue, no surprise for a free service. Would like to run them locally, perhaps using act
: https://github.com/nektos/act
Should incorporate this into the readme somehow, but to run the python server from a podman container the command is:
docker run -i -t -p 5000:5000 (last-image-built) pipenv run gunicorn server:app -b :5000
Ok I have that command as part of a makefile. The workflow isn't totally smooth since this rebuilds the frontend which takes about 15 seconds; ideally the dev server would start in the container with some sort of port mapping... but here's the makefile.
.PHONY: run
all:
podman build .
run:
export IMAGE_ID=$(shell podman images --format "{{.ID}} {{.CreatedAt}}" | sort -rk 2 | head -1 | cut -d ' ' -f 1); \
docker run -i -t -p 5000:5000 $$IMAGE_ID pipenv run gunicorn server:app -b :5000
usage:
make
make run