All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -perfbook] Add Fedora-based Dockerfile
@ 2021-01-10 23:08 Akira Yokosawa
  2021-01-11  1:50 ` Akira Yokosawa
  0 siblings, 1 reply; 3+ messages in thread
From: Akira Yokosawa @ 2021-01-10 23:08 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From d37f98e4ca6cd968af2248d3c719b07ce313a7ec Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Mon, 11 Jan 2021 07:57:58 +0900
Subject: [PATCH -perfbook] Add Fedora-based Dockerfile

For those who prefer Fedora, add an alternative Dockerfile as
docker/Dockerfile.fedora and mention it in FAQ-BUILD.txt.
Also add a few commands in the Focal-based Dockerfile.

Other updates in FAQ-BUILD.txt:
  o Add "texlive-collection-fontutils" to the Fedora package list,
    which includes "epstopdf".
  o Omit some options to "docker run" as they are specified in
    both Dockerfiles.
  o For those who prefer "podman", add instructions to use the
    images with podman.
  o Substitutions:
      "Docker container" -> "container image"
      "docker image"" -> "container image"

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 FAQ-BUILD.txt            | 31 +++++++++++++++++++++++--------
 docker/Dockerfile        |  2 ++
 docker/Dockerfile.fedora | 21 +++++++++++++++++++++
 3 files changed, 46 insertions(+), 8 deletions(-)
 create mode 100644 docker/Dockerfile.fedora

diff --git a/FAQ-BUILD.txt b/FAQ-BUILD.txt
index a590cc77..a7a0711d 100644
--- a/FAQ-BUILD.txt
+++ b/FAQ-BUILD.txt
@@ -37,7 +37,7 @@
 
 	A.	The "pdflatex" package is a variant of Don Knuth's
 		digital typesetting program, which you can install.
-		Alternatively, you can use the Docker container described
+		Alternatively, you can use the container image described
 		in #14 below.  Otherwise, instructions follow.
 
 		On Ubuntu Xenial, installing the following set of
@@ -71,11 +71,12 @@
 			texlive-collection-binextra
 			texlive-collection-latexextra
 			texlive-collection-fontsextra
+			texlive-collection-fontutils
 			fig2ps graphviz inkscape
 
 		On other Linux distributions such as RHEL/CentOS and
 		Scientific Linux, where support of TeX Live packages
-		is insufficient, the aforementioned Docker container
+		is insufficient, the aforementioned container image
 		provides the needed support.  Again, see #14 below.
 
 		Of course, you can install upstream TeX Live.
@@ -284,7 +285,7 @@
 	Can't I just use some container image?
 
 	A.	You can find a template Dockerfile under the docker/
-		subdirectory.  You can pull the docker image built from
+		subdirectory.  You can pull the container image built from
 		it as follows:
 
 		    docker pull akiyks/perfbook-build-focal:latest
@@ -292,16 +293,30 @@
 		It can be run with the command:
 
 		    docker run --rm -it -v <path to perfbook dir>:/work \
-		      -u $(id -u):$(id -g) \
-		      akiyks/perfbook-build-focal:latest bash
+		      akiyks/perfbook-build-focal:latest
 
 		Note:
-		The prebuilt Docker image assumes <uid:pid> = <1000:1000>.
+		The prebuilt container image assumes <uid:pid> = <1000:1000>.
 		If you have different IDs, bash prompt will be in the
 		form of "I have no name!@abcdef012345:/work$".	Builds of
 		perfbook will nevertheless succeed.  You can also build
-		a docker image of your own:
+		a container image of your own:
 
 		    cd docker
-		    docker build -t <docker image tag> \
+		    docker build -t <container image tag> \
 		      --build-arg uid=$(id -u) --build-arg gid=$(id -g) .
+
+		For those prefer a Fedora-based container image,
+		akiyks/perfbook-build-focal:latest is also available.
+		It is built from docker/Dockerfile.fedora.
+
+		If you have podman already installed, you can run the image
+		with podman. podman maps container's root to your host uid
+		by default.
+		Use the following command to run:
+
+		    podman run --rm -it -v <path to perfbook dir>:/work:z \
+		      -u 0:0 akiyks/perfbook-build-fedora:latest
+
+		You will see a prompt with a "#".
+		Your updates under /work will have your host uid in host's POV.
diff --git a/docker/Dockerfile b/docker/Dockerfile
index e2d23c77..a5afe6ea 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -18,4 +18,6 @@ ARG user=perfbook
 ARG group=perfbook
 RUN groupadd -g $gid $group && useradd -u $uid -g $gid -m $user
 VOLUME /work
+USER $uid:$gid
 WORKDIR /work
+CMD /bin/bash
diff --git a/docker/Dockerfile.fedora b/docker/Dockerfile.fedora
new file mode 100644
index 00000000..4a3ab855
--- /dev/null
+++ b/docker/Dockerfile.fedora
@@ -0,0 +1,21 @@
+FROM fedora:latest
+
+RUN dnf -y update && dnf install -y --setopt=tsflags=nodocs \
+    fig2ps graphviz inkscape make git vim nano \
+    texlive-collection-plaingeneric texlive-collection-binextra \
+    texlive-collection-latexextra texlive-epstopdf texlive-fontools \
+    texlive-newtx texlive-newtxtt texlive-nimbus15 texlive-courier-scaled \
+    texlive-inconsolata texlive-newtxsf texlive-mdsymbol && \
+    dnf clean all && \
+    mktexlsr
+COPY steel-city-comic.regular.ttf /usr/local/share/fonts/
+RUN fc-cache /usr/local/share/fonts/
+ARG uid=1000
+ARG gid=1000
+ARG user=perfbook
+ARG group=perfbook
+RUN groupadd -g $gid $group && useradd -u $uid -g $gid -m $user
+VOLUME /work
+USER $uid:$gid
+WORKDIR /work
+CMD /bin/bash
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -perfbook] Add Fedora-based Dockerfile
  2021-01-10 23:08 [PATCH -perfbook] Add Fedora-based Dockerfile Akira Yokosawa
@ 2021-01-11  1:50 ` Akira Yokosawa
  2021-01-11  5:14   ` Paul E. McKenney
  0 siblings, 1 reply; 3+ messages in thread
From: Akira Yokosawa @ 2021-01-11  1:50 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

On Mon, 11 Jan 2021 08:08:39 +0900, Akira Yokosawa wrote:
> From d37f98e4ca6cd968af2248d3c719b07ce313a7ec Mon Sep 17 00:00:00 2001
> From: Akira Yokosawa <akiyks@gmail.com>
> Date: Mon, 11 Jan 2021 07:57:58 +0900
> Subject: [PATCH -perfbook] Add Fedora-based Dockerfile
> 
> For those who prefer Fedora, add an alternative Dockerfile as
> docker/Dockerfile.fedora and mention it in FAQ-BUILD.txt.
> Also add a few commands in the Focal-based Dockerfile.
> 
> Other updates in FAQ-BUILD.txt:
>   o Add "texlive-collection-fontutils" to the Fedora package list,
>     which includes "epstopdf".

Hi Paul,

You might be wondering where epstopdf came from.
It is another alternative to a2ping I'm experimenting with.
On Ubuntu, the existing list of packages covers it.

FWIW, a2ping was forked from early version of epstopdf.
Current maintainer of epstopdf is Karl Berry, who is a key maintainer
of upstream TeX Live.
So in case Ghostscript breaks backward compatibility ever again,
I expect epstopdf would get updated soon.

        Thanks, Akira

>   o Omit some options to "docker run" as they are specified in
>     both Dockerfiles.
>   o For those who prefer "podman", add instructions to use the
>     images with podman.
>   o Substitutions:
>       "Docker container" -> "container image"
>       "docker image"" -> "container image"
> 
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> ---

[...]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -perfbook] Add Fedora-based Dockerfile
  2021-01-11  1:50 ` Akira Yokosawa
@ 2021-01-11  5:14   ` Paul E. McKenney
  0 siblings, 0 replies; 3+ messages in thread
From: Paul E. McKenney @ 2021-01-11  5:14 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook

On Mon, Jan 11, 2021 at 10:50:08AM +0900, Akira Yokosawa wrote:
> On Mon, 11 Jan 2021 08:08:39 +0900, Akira Yokosawa wrote:
> > From d37f98e4ca6cd968af2248d3c719b07ce313a7ec Mon Sep 17 00:00:00 2001
> > From: Akira Yokosawa <akiyks@gmail.com>
> > Date: Mon, 11 Jan 2021 07:57:58 +0900
> > Subject: [PATCH -perfbook] Add Fedora-based Dockerfile
> > 
> > For those who prefer Fedora, add an alternative Dockerfile as
> > docker/Dockerfile.fedora and mention it in FAQ-BUILD.txt.
> > Also add a few commands in the Focal-based Dockerfile.
> > 
> > Other updates in FAQ-BUILD.txt:
> >   o Add "texlive-collection-fontutils" to the Fedora package list,
> >     which includes "epstopdf".
> 
> Hi Paul,
> 
> You might be wondering where epstopdf came from.
> It is another alternative to a2ping I'm experimenting with.
> On Ubuntu, the existing list of packages covers it.
> 
> FWIW, a2ping was forked from early version of epstopdf.
> Current maintainer of epstopdf is Karl Berry, who is a key maintainer
> of upstream TeX Live.
> So in case Ghostscript breaks backward compatibility ever again,
> I expect epstopdf would get updated soon.

Sounds good!  (I queued and pushed this just before cutting -rc2.)

							Thanx, Paul

>         Thanks, Akira
> 
> >   o Omit some options to "docker run" as they are specified in
> >     both Dockerfiles.
> >   o For those who prefer "podman", add instructions to use the
> >     images with podman.
> >   o Substitutions:
> >       "Docker container" -> "container image"
> >       "docker image"" -> "container image"
> > 
> > Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> > ---
> 
> [...]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-11  5:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-10 23:08 [PATCH -perfbook] Add Fedora-based Dockerfile Akira Yokosawa
2021-01-11  1:50 ` Akira Yokosawa
2021-01-11  5:14   ` Paul E. McKenney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.