Skip to content

Commit

Permalink
yeet podman
Browse files Browse the repository at this point in the history
  • Loading branch information
Headary committed Dec 29, 2023
1 parent 0fa2770 commit 7adecd7
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ docker/*
!docker/entrypoint.sh
!docker/ssh.conf
!docker/sshd.conf
!docker/libpod.conf
!docker/storage.conf
!docker/daemon.json
2 changes: 1 addition & 1 deletion astrid/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _build(self, reponame):
print(f"Building {reponame}")
logfilename = os.path.expanduser(f"/data/log/{reponame}.build.log")
logfile = open(logfilename, "w")
p = subprocess.run(["podman", "run", "--rm", "-v", f"{cwd}:/usr/src/local", f"fykosak/buildtools:{image_version}"] + cmd.split(), cwd=cwd, stdout=logfile, stderr=logfile, check=False)
p = subprocess.run(["docker", "run", "--rm", "-v", f"{cwd}:/usr/src/local", f"fykosak/buildtools:{image_version}"] + cmd.split(), cwd=cwd, stdout=logfile, stderr=logfile, check=False)
logfile.close()
return p.returncode == 0

Expand Down
5 changes: 2 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:3.12

# install docker
RUN apt update && apt install -y podman containers-storage
RUN apt update && apt install -y docker.io containers-storage

# change workdir
WORKDIR /app
Expand All @@ -15,8 +15,7 @@ COPY ./docker/ssh.conf /etc/ssh/ssh_config.d/99-astrid.conf
COPY ./docker/sshd.conf /etc/ssh/sshd_config.d/99-astrid.conf

# copy containers config
COPY ./docker/libpod.conf /etc/containers/libpod.conf
COPY ./docker/storage.conf /etc/containers/storage.conf
COPY ./docker/daemon.json /etc/docker/daemon.json

# install astrid
COPY . .
Expand Down
6 changes: 6 additions & 0 deletions docker/daemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"data-root": "/data/containers",
"live-restore": true,
"log-driver": "json-file",
"init": true
}
4 changes: 2 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ services:
container_name: astrid
environment:
TZ: 'Europe/Prague'
PUID: 950
GUID: 65534
PUID: 1000
GUID: 1000
privileged: true # needed for containers
volumes:
- ./data:/data
Expand Down
2 changes: 2 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if [ ! $(getent passwd astrid) ] && [ ! $(getent passwd $PUID) ]; then
fi

USER=$(id -nu $PUID)
usermod -a -G docker $USER

# add to subuid and subgid
if ! $(checksubid $USER /etc/subuid); then
Expand All @@ -55,4 +56,5 @@ if [ $(ls "/data/ssh" | grep ".pub" | wc -l) -eq 0 ]; then
su - $USER -c "ssh-keygen -t ed25519 -f /data/ssh/id_ed25519"
fi

dockerd &
su - $USER -c "python3 -u /app/main"
1 change: 0 additions & 1 deletion docker/libpod.conf

This file was deleted.

3 changes: 0 additions & 3 deletions docker/storage.conf

This file was deleted.

0 comments on commit 7adecd7

Please sign in to comment.