From 3e3ec9c41beecdf119ea8e80dd6da5e5ab7adbde Mon Sep 17 00:00:00 2001 From: Nikolaos Boutalas Date: Mon, 7 Aug 2023 12:54:09 +0300 Subject: Introduce Fedora Dockerfile --- Dockerfile | 19 ------------------- Dockerfile.fedora | 19 +++++++++++++++++++ Dockerfile.ubuntu | 19 +++++++++++++++++++ README.md | 5 +++-- 4 files changed, 41 insertions(+), 21 deletions(-) delete mode 100644 Dockerfile create mode 100644 Dockerfile.fedora create mode 100644 Dockerfile.ubuntu diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 2668fad..0000000 --- a/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM ubuntu:latest - -RUN apt-get update && \ - apt-get install -y ansible python3-apt - -RUN apt-get install -y sudo \ - && useradd -m -s /bin/bash admin \ - && echo "admin ALL=(ALL) ALL" >> /etc/sudoers \ - && passwd -d root - -RUN echo 'admin:admin' | chpasswd - -USER admin -WORKDIR /home/admin - -COPY --chown=admin . init -WORKDIR init - -CMD ["/bin/bash"] diff --git a/Dockerfile.fedora b/Dockerfile.fedora new file mode 100644 index 0000000..b0781cd --- /dev/null +++ b/Dockerfile.fedora @@ -0,0 +1,19 @@ +FROM fedora:latest + +RUN dnf update -y && \ + dnf install -y ansible + +RUN dnf install -y passwd \ + && useradd -m -s /bin/bash admin \ + && echo "admin ALL=(ALL) ALL" >> /etc/sudoers \ + && passwd -d root + +RUN echo 'admin:admin' | chpasswd + +USER admin +WORKDIR /home/admin + +COPY --chown=admin . init +WORKDIR init + +CMD ["/bin/bash"] diff --git a/Dockerfile.ubuntu b/Dockerfile.ubuntu new file mode 100644 index 0000000..2668fad --- /dev/null +++ b/Dockerfile.ubuntu @@ -0,0 +1,19 @@ +FROM ubuntu:latest + +RUN apt-get update && \ + apt-get install -y ansible python3-apt + +RUN apt-get install -y sudo \ + && useradd -m -s /bin/bash admin \ + && echo "admin ALL=(ALL) ALL" >> /etc/sudoers \ + && passwd -d root + +RUN echo 'admin:admin' | chpasswd + +USER admin +WORKDIR /home/admin + +COPY --chown=admin . init +WORKDIR init + +CMD ["/bin/bash"] diff --git a/README.md b/README.md index 935b160..bca2782 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,13 @@ ## Development -In order to test this, you can use *Docker* and build a simple Ubuntu container +In order to test this, you can use *Docker* and build a simple Linux container ```bash git clone git@github.com:nikolaosboutalas/init.git cd init - docker build . -t ansible && docker run --rm -it ansible + # Build a docker container with the specified distribution + docker build . -t ansible -f Dockerfile. && docker run --rm -it ansible # Inside the new running container ./setup.sh ``` -- cgit v1.2.3