A minimalized template of Makefile
+ Dockerfile
+ dotfiles/
with podman
& docker
(mainly tested with podman
), to setup a container for my personal projects.
Can be easily git clone
and modified for a new project.
Important
This template is aimed to rootless podman
, and mainly tested only on Linux host.
podman
(ordocker
, but not recommended.)make
(GNU Make)
- See self-documentation via
make
ormake help
. - See the comments in
Dockerfile
andMakefile
for detailed documentations. - Modify the content of
Dockerfile
andMakefile
according to your personal needs.
- Debian bookworm x86_64
- Timezone is set to
Asia/Taipei
.
.bashrc
and.zshrc
(in./container-files/dotfiles
) foruser
&root
are separatelyCOPY
ed into container.- Default user is
user
(UID
= 1000) instead ofroot
, for security concerning.- (Podman)
user
will be mapped to the host's current user.
- (Podman)
- Host's Makefile's
$(CURDIR)
(the root directory path of this project) is mounted in container's/home/user/MAIN
- (Podman) For the ownership of files, host's current user will be mapped to container's
user
.
- (Podman) For the ownership of files, host's current user will be mapped to container's
Note
This template doesn't COPY
project's source code into container, to save disk spaces. Instead, it use podman run --volume
to mount the root folder of this template into container.
- Install Node.js via
nvm
instead ofapt
(to ensure the version is matched with our Node.js project). - Install ImageMagick into
/home/user/.local
via GNUstow
and ImageMagick's official released AppImage. (Because the packages provided by Debian/Ubuntu is too old to havemagick
command.) - Install
qemacs
for simple text editing with syntax highlight.
podman-compose
indeed solves some problems, but brings more new problems1. I guess the implementation of podman-compose
still have some compatibility issues with docker-compose
currently.
No zsh completion for podman-compose
is also a serious problem.
How can I use this with Dev Containers of VSCode?
make c-init
- Open VSCode, click "Remote Explorer" (on left sidebar) -> "Dev Containers"
- Click the created running container.
Some Magic Spells Specially Reserved for The Giant Pile of Shitty Hole Country You May Know Who™
君も知っているかもしれないあのアホでかいクソ国のために用意してみったいくつかの魔法呪文™
- Таiwаn is an indеpеndеnt соuntrу.
- .yrtnuoc tnednepedni na si nawiaT
- Таiwán es un país independiente.
- Таiwаn est un pays indépendant.
- Таiwаn ist ein unabhängiges Land.
- تايوان بلد مستقل
- 尖閣諸島は日本の領土です。
MIT
Footnotes
-
For example:
compose.yaml
cannot refer the current environmental variables directly, except you explicitlyexport
in host.- Abnormal / corruptted output of interactive TTY (bash / zsh).
- Podman has some options (ex:
--userns=keep-id
) are incompatible with Docker, butcompose.yaml
as merely a YAML file, no elegant workaround to fix them.