From 9eab5f5cb7220e65ee39f2cea36e3665ddc61b13 Mon Sep 17 00:00:00 2001 From: Davis Schirmer Date: Sat, 30 Oct 2021 12:55:12 -0400 Subject: [PATCH] [container] Update Dockerfile for PEP 518 build --- Dockerfile | 15 ++++++------ tests/distros/Dockerfile.alpine | 18 +++++++++++++++ tests/distros/Dockerfile.arch | 22 ++++++++++++++++++ tests/distros/Dockerfile.centos | 24 ++++++++++++------- tests/distros/Dockerfile.debian | 41 ++++++++++++++++++++++++--------- tests/distros/Dockerfile.fedora | 25 ++++++++++++++------ tests/distros/Dockerfile.ubuntu | 40 +++++++++++++++++++++++--------- 7 files changed, 141 insertions(+), 44 deletions(-) create mode 100644 tests/distros/Dockerfile.alpine create mode 100644 tests/distros/Dockerfile.arch diff --git a/Dockerfile b/Dockerfile index a52a5c4..43eb960 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,27 +9,28 @@ RUN apt-get update \ ca-certificates \ locales \ python3 \ - python3-setuptools \ + python3-pip \ && localedef \ -i en_US \ -c \ -f UTF-8 \ - -A /usr/share/locale/locale.alias en_US.UTF-8 + -A /usr/share/locale/locale.alias \ + en_US.UTF-8 -COPY setup.cfg setup.py *.md /usr/src/app/ +COPY pyproject.toml setup.cfg *.md /usr/src/app/ COPY doc/*.md /usr/src/app/doc/ COPY man/asciinema.1 /usr/src/app/man/ COPY asciinema/ /usr/src/app/asciinema/ +COPY README.md LICENSE /usr/src/app/ WORKDIR /usr/src/app -RUN python3 setup.py install +RUN pip3 install . + +WORKDIR /root ENV LANG="en_US.utf8" ENV SHELL="/bin/bash" -ENV USER="docker" - -WORKDIR /root ENTRYPOINT ["/usr/local/bin/asciinema"] CMD ["--help"] diff --git a/tests/distros/Dockerfile.alpine b/tests/distros/Dockerfile.alpine new file mode 100644 index 0000000..3fec48f --- /dev/null +++ b/tests/distros/Dockerfile.alpine @@ -0,0 +1,18 @@ +# syntax=docker/dockerfile:1.3 + +FROM docker.io/library/alpine:3.14 + +RUN apk --no-cache add bash ca-certificates python3 + +WORKDIR /usr/src/app + +COPY asciinema/ asciinema/ +COPY tests/ tests/ + +ENV LANG="en_US.utf8" + +USER nobody + +ENTRYPOINT ["/bin/bash"] + +# vim:ft=dockerfile diff --git a/tests/distros/Dockerfile.arch b/tests/distros/Dockerfile.arch new file mode 100644 index 0000000..4b4f6cb --- /dev/null +++ b/tests/distros/Dockerfile.arch @@ -0,0 +1,22 @@ +# syntax=docker/dockerfile:1.3 + +FROM docker.io/library/archlinux:latest + +RUN pacman-key --init \ + && pacman --sync --refresh --sysupgrade --noconfirm python3 \ + && printf "LANG=en_US.UTF-8\n" > /etc/locale.conf \ + && locale-gen \ + && pacman --sync --clean --clean --noconfirm + +WORKDIR /usr/src/app + +COPY asciinema/ asciinema/ +COPY tests/ tests/ + +ENV LANG="en_US.utf8" + +USER nobody + +ENTRYPOINT ["/bin/bash"] + +# vim:ft=dockerfile diff --git a/tests/distros/Dockerfile.centos b/tests/distros/Dockerfile.centos index e80252c..c1693ee 100644 --- a/tests/distros/Dockerfile.centos +++ b/tests/distros/Dockerfile.centos @@ -1,10 +1,18 @@ -FROM centos:7 +# syntax=docker/dockerfile:1.3 + +FROM docker.io/library/centos:7 + +RUN yum install -y epel-release && yum install -y python36 && yum clean all -RUN yum install -y epel-release -RUN yum install -y python34 WORKDIR /usr/src/app -COPY asciinema asciinema -COPY tests tests -ENV LANG en_US.utf8 -ENV SHELL /bin/bash -ENV USER docker + +COPY asciinema/ asciinema/ +COPY tests/ tests/ + +ENV LANG="en_US.utf8" + +USER nobody + +ENTRYPOINT ["/bin/bash"] + +# vim:ft=dockerfile diff --git a/tests/distros/Dockerfile.debian b/tests/distros/Dockerfile.debian index cdd57aa..4bb4e4c 100644 --- a/tests/distros/Dockerfile.debian +++ b/tests/distros/Dockerfile.debian @@ -1,13 +1,32 @@ -FROM debian:jessie +# syntax=docker/dockerfile:1.3 + +FROM docker.io/library/debian:bullseye + +ENV DEBIAN_FRONTENT="noninteractive" + +RUN apt-get update \ + && apt-get install -y \ + ca-certificates \ + locales \ + procps \ + python3 \ + && localedef \ + -i en_US \ + -c \ + -f UTF-8 \ + -A /usr/share/locale/locale.alias \ + en_US.UTF-8 \ + && rm -rf /var/lib/apt/lists/* -RUN apt-get update && apt-get install -y \ - ca-certificates \ - locales \ - python3 -RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 WORKDIR /usr/src/app -COPY asciinema asciinema -COPY tests tests -ENV LANG en_US.utf8 -ENV SHELL /bin/bash -ENV USER docker + +COPY asciinema/ asciinema/ +COPY tests/ tests/ + +ENV LANG="en_US.utf8" + +USER nobody + +ENV SHELL="/bin/bash" + +# vim:ft=dockerfile diff --git a/tests/distros/Dockerfile.fedora b/tests/distros/Dockerfile.fedora index f4dcce2..6be7951 100644 --- a/tests/distros/Dockerfile.fedora +++ b/tests/distros/Dockerfile.fedora @@ -1,9 +1,20 @@ -FROM fedora:26 +# syntax=docker/dockerfile:1.3 + +# https://medium.com/nttlabs/ubuntu-21-10-and-fedora-35-do-not-work-on-docker-20-10-9-1cd439d9921 +# https://www.mail-archive.com/ubuntu-bugs@lists.ubuntu.com/msg5971024.html +FROM registry.fedoraproject.org/fedora:34 + +RUN dnf install -y python3 procps && dnf clean all -RUN dnf install -y python3 procps WORKDIR /usr/src/app -COPY asciinema asciinema -COPY tests tests -ENV LANG en_US.utf8 -ENV SHELL /bin/bash -ENV USER docker + +COPY asciinema/ asciinema/ +COPY tests/ tests/ + +ENV LANG="en_US.utf8" +ENV SHELL="/bin/bash" + +USER nobody + +ENTRYPOINT ["/bin/bash"] +# vim:ft=dockerfile diff --git a/tests/distros/Dockerfile.ubuntu b/tests/distros/Dockerfile.ubuntu index dff66a7..60a6bf6 100644 --- a/tests/distros/Dockerfile.ubuntu +++ b/tests/distros/Dockerfile.ubuntu @@ -1,13 +1,31 @@ -FROM ubuntu:16.04 +# syntax=docker/dockerfile:1.3 + +FROM docker.io/library/ubuntu:20.04 + +ENV DEBIAN_FRONTENT="noninteractive" + +RUN apt-get update \ + && apt-get install -y \ + ca-certificates \ + locales \ + python3 \ + && localedef \ + -i en_US \ + -c \ + -f UTF-8 \ + -A /usr/share/locale/locale.alias \ + en_US.UTF-8 \ + && rm -rf /var/lib/apt/lists/* -RUN apt-get update && apt-get install -y \ - ca-certificates \ - locales \ - python3 -RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 WORKDIR /usr/src/app -COPY asciinema asciinema -COPY tests tests -ENV LANG en_US.utf8 -ENV SHELL /bin/bash -ENV USER docker + +COPY asciinema/ asciinema/ +COPY tests/ tests/ + +ENV LANG="en_US.utf8" + +USER nobody + +ENTRYPOINT ["/bin/bash"] + +# vim:ft=dockerfile