Skip to content

Commit

Permalink
starting build a python docker wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasu77df committed Dec 5, 2023
1 parent 0db4800 commit 6fe404d
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 27 deletions.
53 changes: 26 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM public.ecr.aws/debian/debian:trixie
FROM public.ecr.aws/amazonlinux/amazonlinux:latest
LABEL maintainer="Vasudevan Perumal"

ARG DEBIAN_FRONTEND=noninteractive
Expand All @@ -8,32 +8,32 @@ RUN cat /etc/apt/sources.list.d/*
# To get access to the ubuntu-keyring package
RUN echo "deb https://ftp.de.debian.org/debian sid main" >> /etc/apt/sources.list
RUN apt update
# RUN apt upgrade -y
# RUN apt install -y --fix-broken libreadline8
RUN apt upgrade -y
RUN apt install -y --fix-broken libreadline8
RUN apt install --fix-broken --yes --no-install-recommends \
build-essential \
bubblewrap \
cpio \
curl \
dosfstools \
e2fsprogs \
git \
iproute2 \
procps \
python3-apt \
python3-dev \
python3-pip \
python3-setuptools \
python3-venv \
python3-wheel \
sudo \
squashfs-tools \
systemd \
systemd-boot \
systemd-sysv \
mtools \
ubuntu-keyring \
zstd \
build-essential \
bubblewrap \
cpio \
curl \
dosfstools \
e2fsprogs \
git \
iproute2 \
procps \
python3-apt \
python3-dev \
python3-pip \
python3-setuptools \
python3-venv \
python3-wheel \
sudo \
squashfs-tools \
systemd \
systemd-boot \
systemd-sysv \
mtools \
ubuntu-keyring \
zstd \
&& rm --force --recursive /var/lib/apt/lists/* \
&& rm --force --recursive /usr/share/doc \
&& rm --force --recursive /usr/share/man \
Expand All @@ -42,7 +42,6 @@ RUN apt install --fix-broken --yes --no-install-recommends \

WORKDIR /root/image_build


COPY definitions/ /root/image_build/

RUN chmod 600 mkosi.rootpw
Expand Down
29 changes: 29 additions & 0 deletions build_image.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/python3

import argparse
import subprocess
import os
from contextlib import contextmanager

parser = argparse.ArgumentParser(description="A simple docker wrapper to run mkosi in a docker container", usage="whaled-mkosi --build")
parser.add_argument("-d", "--debug", actions="store_true", help="Verbose Logging")
parser.add_argument("--build", actions="store_true", help="Build mkosi-builder container and run the image build")
parser.add_argument
@contextmanager
def step_wrapper(stepname: str):
print(f'Running {stepname}')
try:
yield
except Exception:
print(f'Exception during {stepname}')
raise


def main():
with step_wrapper('Listing Docker Cont'):
print('steps')

try:
main()
except Exception as e:
print('we gotta exception houston', e)

0 comments on commit 6fe404d

Please sign in to comment.