Update the Dockerfiles

Noah 2022-01-03 21:03:31 -08:00
parent 9638b67a4e
commit f3e1fdd217
4 changed files with 44 additions and 10 deletions

View File

@ -10,13 +10,14 @@
FROM i386/debian:latest
ENV GOPATH /go
ENV GOPROXY direct
ENV PATH /opt/go/bin:/bin:/sbin:/usr/bin:/usr/sbin:/go/bin
ENV PATH /opt/go/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/go/bin
# Debian: Update all software and get dependencies.
# RUN dnf -y update
RUN apt update && apt -y upgrade && apt -y dist-upgrade
RUN apt -y install git zip tar libsdl2-dev libsdl2-ttf-dev \
libsdl2-mixer-dev gcc-mingw-w64-i686 gcc make wget
libsdl2-mixer-dev gcc-mingw-w64-i686 gcc make wget \
flatpak-builder ruby-dev gcc rpm libffi-dev
# Create a user to build the packages.
RUN useradd builder -u 1000 -m -G users && \
@ -69,7 +70,7 @@ RUN cp -r /git/vendor/fonts ./assets/fonts && \
mkdir rtp && cp -r /git/rtp/* rtp/
RUN ls -hal && pwd
RUN mkdir -p bin && cp /git/vendor/DLL/*.dll bin/
RUN mkdir -p bin && cp /git/vendor/DLL-32bit/*.dll bin/
# Package rpm and deb for Linux.
# TODO: fpm doesn't like to install in Docker right now
@ -86,4 +87,6 @@ RUN gem install fpm; exit 0
# zip them all up nicely.
RUN make mingw32-release
CMD ["cp", "-r", "-v", "/go/src/git.kirsle.net/apps/doodle/dist/", "/mnt/export/"]
CMD ["cp", "-r", "-v", \
"/go/src/git.kirsle.net/apps/doodle/dist/release/", \
"/mnt/export/"]

View File

@ -8,15 +8,15 @@
##
FROM fedora:latest
MAINTAINER Noah Petherbridge <root@kirsle.net>
ENV GOPATH /go
ENV GOPROXY direct
ENV PATH /bin:/sbin:/usr/bin:/usr/sbin:/go/bin
ENV PATH /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/go/bin
# Fedora: Update all software and get dependencies.
# RUN dnf -y update
RUN dnf -y install git zip tar golang SDL2-devel SDL2_ttf-devel \
SDL2_mixer-devel mingw64-gcc make wget
SDL2_mixer-devel mingw64-gcc make wget \
flatpak-builder ruby-devel gcc rpm-build libffi-devel
# Create a user to build the packages.
RUN useradd builder -u 1000 -m -G users && \
@ -67,7 +67,7 @@ RUN mkdir -p bin && cp /git/vendor/DLL/*.dll bin/
# Package rpm and deb for Linux.
# TODO: fpm doesn't like to install in Docker right now
RUN dnf -y install ruby-devel gcc rpm-build libffi-devel
# RUN dnf -y install ruby-devel gcc rpm-build libffi-devel
RUN gem install fpm; exit 0
# Run the big mingw-release, which:
@ -80,4 +80,24 @@ RUN gem install fpm; exit 0
# zip them all up nicely.
RUN make mingw-release
CMD ["sudo", "cp", "-r", "-v", "/go/src/git.kirsle.net/apps/doodle/dist/", "/mnt/export/"]
###
# Build the Flatpak release for Linux.
# RUN git clone https://code.sketchymaze.com/game/flatpak /git/flatpak
# # Fetch flatpak dependencies.
# RUN flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo && \
# flatpak install -y org.freedesktop.Sdk//21.08 && \
# flatpak install -y org.freedesktop.Sdk.Extension.golang//21.08
# # Path the go.mod `replace` directives to Flatpak's sandbox paths,
# # then build the Flatpak.
# RUN sed -i 's/=> \/git\/go\//=> \/run\/build\/sketchymaze\/deps\//g' go.mod && \
# cat go.mod
# WORKDIR /git/flatpak
# RUN make bundle; exit 0
# WORKDIR /go/src/git.kirsle.net/apps/doodle
CMD ["sudo", "cp", "-r", "-v", \
"/go/src/git.kirsle.net/apps/doodle/dist/release/", \
# "/git/flatpak/*.flatpak", \
"/mnt/export/"]

View File

@ -3,6 +3,7 @@ SHELL := /bin/bash
# NOTE:
# Fedora likes `podman` instead of `docker` but most other
# distros (Debian, Manjaro) `docker` is easier to use.
# ln -s /usr/bin/podman ~/bin/docker
.PHONY: clean
clean:
@ -21,4 +22,4 @@ clean:
mkdir -p ./dist/32bit
echo pwd is $(shell pwd)
docker build -t doodle_32bit -f ./32bit.dockerfile .
docker run --rm --mount type=bind,src=$(shell pwd)/dist/32bit,dst=/mnt/export doodle_32bit
docker run --rm --mount type=bind,src=$(shell pwd)/dist/32bit,dst=/mnt/export doodle_32bit

View File

@ -10,6 +10,16 @@ and the makefile ought to "just work" (provided all the git repositories are
up and the heads are not broken). Also reading the Dockerfile can give you
an idea of the end-to-end process of the build.
Run `make setup` to add flathub (--if-not-exists) and download the dependency
layers.
```
make mingw
```
Podman tip: `podman system reset` to nuke all of it, cached images and build
steps, for a fresh start when testing the dockerfiles.
**Fedora tip:** run `setenforce permissive` to disable SELinux for the
bind mount, or podman/docker can't copy artifacts from the Docker
container up to the host.