Fedora Dockerfile for building
This commit is contained in:
parent
92847fc3b7
commit
569e67bf9e
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,6 +4,7 @@ bin/
|
||||||
dist/
|
dist/
|
||||||
docker/ubuntu
|
docker/ubuntu
|
||||||
docker/debian
|
docker/debian
|
||||||
|
docker/fedora
|
||||||
screenshot-*.png
|
screenshot-*.png
|
||||||
map-*.json
|
map-*.json
|
||||||
pkg/wallpaper/*.png
|
pkg/wallpaper/*.png
|
||||||
|
|
34
Building.md
Normal file
34
Building.md
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
# Building Doodle
|
||||||
|
|
||||||
|
Makefile commands for Linux:
|
||||||
|
|
||||||
|
* `make setup`: install Go dependencies and set up the build environment
|
||||||
|
* `make build`: build the Doodle and Doodad binaries to the `bin/` folder.
|
||||||
|
* `make run`: run a local dev build of Doodle in debug mode
|
||||||
|
* `make guitest`: run a local dev build in the GUITest scene
|
||||||
|
* `make test`: run the test suite
|
||||||
|
* `make dist`: produce a zipped release tarball and zip file for your current
|
||||||
|
environment and output into the `dist/` folder.
|
||||||
|
* `make docker`: run all the Dockerfiles from the `docker/` folder to produce
|
||||||
|
dist builds for Debian, Fedora and Ubuntu. You may also run these builds
|
||||||
|
individually:
|
||||||
|
* `make docker.ubuntu`
|
||||||
|
* `make docker.debian`
|
||||||
|
* `make docker.fedora`
|
||||||
|
* `make clean`: clean all build artifacts
|
||||||
|
|
||||||
|
## Linux
|
||||||
|
|
||||||
|
Dependencies are Go, SDL2 and SDL2_ttf:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Fedora
|
||||||
|
sudo dnf -y install golang SDL2-devel SDL2_ttf-devel
|
||||||
|
|
||||||
|
# Ubuntu and Debian
|
||||||
|
sudo apt -y install golang libsdl2-dev libsdl2-ttf-dev
|
||||||
|
```
|
||||||
|
|
||||||
|
## Windows
|
||||||
|
|
||||||
|
TBD.
|
9
Makefile
9
Makefile
|
@ -44,18 +44,21 @@ dist: build
|
||||||
cd dist && zip -r doodle-$(VERSION).zip doodle-$(VERSION)
|
cd dist && zip -r doodle-$(VERSION).zip doodle-$(VERSION)
|
||||||
|
|
||||||
# `make docker` to run the Docker builds
|
# `make docker` to run the Docker builds
|
||||||
.PHONY: docker docker.ubuntu docker.debian __docker.dist
|
.PHONY: docker docker.ubuntu docker.debian docker.fedora __docker.dist
|
||||||
docker.ubuntu:
|
docker.ubuntu:
|
||||||
mkdir -p docker/ubuntu
|
mkdir -p docker/ubuntu
|
||||||
./docker/dist-ubuntu.sh
|
./docker/dist-ubuntu.sh
|
||||||
docker.debian:
|
docker.debian:
|
||||||
mkdir -p docker/debian
|
mkdir -p docker/debian
|
||||||
./docker/dist-debian.sh
|
./docker/dist-debian.sh
|
||||||
docker: docker.ubuntu docker.debian
|
docker.fedora:
|
||||||
|
mkdir -p docker/fedora
|
||||||
|
./docker/dist-fedora.sh
|
||||||
|
docker: docker.ubuntu docker.debian docker.fedora
|
||||||
__docker.dist: dist
|
__docker.dist: dist
|
||||||
cp dist/*.tar.gz dist/*.zip /mnt/export/
|
cp dist/*.tar.gz dist/*.zip /mnt/export/
|
||||||
|
|
||||||
# `make clean` cleans everything up.
|
# `make clean` cleans everything up.
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -rf bin dist
|
rm -rf bin dist docker/ubuntu docker/debian docker/fedora
|
||||||
|
|
|
@ -8,8 +8,7 @@ RUN apt update && apt -y upgrade && \
|
||||||
apt clean
|
apt clean
|
||||||
|
|
||||||
# Create a user to build the packages.
|
# Create a user to build the packages.
|
||||||
RUN useradd builder -u 1000 -m -G users && \
|
RUN useradd builder -u 1000 -m -G users
|
||||||
echo "builder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
|
||||||
|
|
||||||
# Add the project to the GOPATH
|
# Add the project to the GOPATH
|
||||||
ADD . /home/builder/go/src/git.kirsle.net/apps/doodle
|
ADD . /home/builder/go/src/git.kirsle.net/apps/doodle
|
||||||
|
@ -19,5 +18,4 @@ RUN chown -R builder:builder /home/builder/go
|
||||||
USER builder
|
USER builder
|
||||||
WORKDIR /home/builder/go/src/git.kirsle.net/apps/doodle
|
WORKDIR /home/builder/go/src/git.kirsle.net/apps/doodle
|
||||||
RUN make setup
|
RUN make setup
|
||||||
RUN make dist
|
|
||||||
CMD ["make", "__docker.dist"]
|
CMD ["make", "__docker.dist"]
|
||||||
|
|
21
docker/Fedora.dockerfile
Normal file
21
docker/Fedora.dockerfile
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
FROM fedora:latest
|
||||||
|
MAINTAINER Noah Petherbridge <root@kirsle.net>
|
||||||
|
ENV GOPATH /home/builder/go
|
||||||
|
|
||||||
|
# Update all the software and then install Go, git, SDL2 and other dependencies
|
||||||
|
RUN dnf -y update && \
|
||||||
|
dnf -y install git zip golang SDL2-devel SDL2_ttf-devel make && \
|
||||||
|
dnf clean all
|
||||||
|
|
||||||
|
# Create a user to build the packages.
|
||||||
|
RUN useradd builder -u 1000 -m -G users
|
||||||
|
|
||||||
|
# Add the project to the GOPATH
|
||||||
|
ADD . /home/builder/go/src/git.kirsle.net/apps/doodle
|
||||||
|
WORKDIR /home/builder/go/src/git.kirsle.net/apps/doodle
|
||||||
|
RUN chown -R builder:builder /home/builder/go
|
||||||
|
|
||||||
|
# Build the app as the `builder` user
|
||||||
|
USER builder
|
||||||
|
RUN make setup
|
||||||
|
CMD ["make", "__docker.dist"]
|
|
@ -2,22 +2,21 @@ FROM ubuntu:latest
|
||||||
MAINTAINER Noah Petherbridge <root@kirsle.net>
|
MAINTAINER Noah Petherbridge <root@kirsle.net>
|
||||||
ENV GOPATH /home/builder/go
|
ENV GOPATH /home/builder/go
|
||||||
|
|
||||||
RUN apt update && apt -y upgrade && \
|
# Update all the software and then install Go, git, SDL2 and other dependencies
|
||||||
apt -y install git zip golang \
|
RUN apt update && \
|
||||||
libsdl2-dev libsdl2-ttf-dev make && \
|
apt -y upgrade && \
|
||||||
|
apt -y install git zip golang libsdl2-dev libsdl2-ttf-dev make && \
|
||||||
apt clean
|
apt clean
|
||||||
|
|
||||||
# Create a user to build the packages.
|
# Create a user to build the packages.
|
||||||
RUN useradd builder -u 1000 -m -G users && \
|
RUN useradd builder -u 1000 -m -G users
|
||||||
echo "builder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
|
||||||
|
|
||||||
# Add the project to the GOPATH
|
# Add the project to the GOPATH
|
||||||
ADD . /home/builder/go/src/git.kirsle.net/apps/doodle
|
ADD . /home/builder/go/src/git.kirsle.net/apps/doodle
|
||||||
|
WORKDIR /home/builder/go/src/git.kirsle.net/apps/doodle
|
||||||
RUN chown -R builder:builder /home/builder/go
|
RUN chown -R builder:builder /home/builder/go
|
||||||
|
|
||||||
# Build the app
|
# Build the app as the `builder` user
|
||||||
USER builder
|
USER builder
|
||||||
WORKDIR /home/builder/go/src/git.kirsle.net/apps/doodle
|
|
||||||
RUN make setup
|
RUN make setup
|
||||||
RUN make dist
|
|
||||||
CMD ["make", "__docker.dist"]
|
CMD ["make", "__docker.dist"]
|
||||||
|
|
10
docker/dist-fedora.sh
Executable file
10
docker/dist-fedora.sh
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Run this script from the root of the repo.
|
||||||
|
if [[ ! -f "./docker/dist-fedora.sh" ]]; then
|
||||||
|
echo "Run this script from the root of the doodle repo, i.e.: ./docker/dist-fedora.sh"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo docker build -t doodle_fedora -f ./docker/Fedora.dockerfile .
|
||||||
|
sudo docker run --rm -v "$(pwd)/docker/fedora:/mnt/export:z" doodle_fedora
|
|
@ -44,7 +44,7 @@ func TestPointInside(t *testing.T) {
|
||||||
W: 490,
|
W: 490,
|
||||||
},
|
},
|
||||||
p: render.NewPoint(509, 260),
|
p: render.NewPoint(509, 260),
|
||||||
shouldPass: true,
|
shouldPass: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user