mirror of
https://github.com/gwenhael-le-moine/x48.git
synced 2025-01-12 20:01:13 +01:00
Merge pull request #5 from gwenhael-le-moine/dockerize_x48_v1
Adding the parts needed to run x48 in a Docker container, for portability.
This commit is contained in:
commit
15e517274b
3 changed files with 58 additions and 0 deletions
28
Dockerfile
Normal file
28
Dockerfile
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
FROM i386/alpine:3.11 AS build
|
||||||
|
|
||||||
|
#Install the necessary things to build x48
|
||||||
|
RUN apk update && apk add bzip2 make vim gcc libx11-dev autoconf automake libc6-compat man-pages xtrans libxau-dev libxdmcp-dev libx11-dev pkgconf libxt-dev g++
|
||||||
|
|
||||||
|
#Copy over the necessary files to build x48
|
||||||
|
WORKDIR /app
|
||||||
|
COPY configure.ac version.m4 Makefile.am autogen.sh INSTALL NEWS README AUTHORS ChangeLog ./
|
||||||
|
COPY src src
|
||||||
|
COPY romdump romdump
|
||||||
|
COPY rpm rpm
|
||||||
|
COPY ROMs ROMs
|
||||||
|
COPY utils utils
|
||||||
|
RUN ./autogen.sh
|
||||||
|
RUN ./configure
|
||||||
|
RUN make
|
||||||
|
RUN cd ROMs; bunzip2 *.bz2
|
||||||
|
|
||||||
|
#Squash the layers into a smaller image with only the necessary parts.
|
||||||
|
FROM i386/alpine:3.11 as final
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=build /app/src/x48 .
|
||||||
|
COPY --from=build /app/ROMs ./
|
||||||
|
COPY --from=build /usr/lib/libX11.so.6 /usr/lib/libxcb.so.1 /usr/lib/libXau.so.6 /usr/lib/libXdmcp.so.6 /usr/lib/libbsd.so.0 /usr/lib/
|
||||||
|
|
||||||
|
|
||||||
|
ENTRYPOINT ["./x48","-quiet"]
|
||||||
|
CMD ["-rom", "gxrom-r"]
|
29
runx48.sh
Executable file
29
runx48.sh
Executable file
|
@ -0,0 +1,29 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#TODO:
|
||||||
|
# Check for the docker exec and that the user has access to start containers.
|
||||||
|
|
||||||
|
start_x48 () {
|
||||||
|
docker run --rm --network none \
|
||||||
|
--volume="/tmp/.X11-unix:/tmp/.X11-unix" \
|
||||||
|
--volume="/home/$USER:/home/$USER" \
|
||||||
|
--volume="/etc/group:/etc/group:ro" \
|
||||||
|
--volume="/etc/passwd:/etc/passwd:ro" \
|
||||||
|
--volume="/etc/shadow:/etc/shadow:ro" \
|
||||||
|
--volume="/etc/sudoers.d:/etc/sudoers.d:ro" \
|
||||||
|
--env="DISPLAY" \
|
||||||
|
--user $(id -u):$(id -g) \
|
||||||
|
danwitt/x48 $@
|
||||||
|
}
|
||||||
|
|
||||||
|
# IF we can't pull the image, then we need to build it
|
||||||
|
if [[ $1 == "--build" ]]; then
|
||||||
|
#Run the build process
|
||||||
|
docker build -t danwitt/x48 .
|
||||||
|
#If the build was good, start x48
|
||||||
|
if [[ $? == 0 ]]; then
|
||||||
|
start_x48 $@
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
start_x48 $@
|
||||||
|
fi
|
|
@ -3630,6 +3630,7 @@ int buflen;
|
||||||
#endif
|
#endif
|
||||||
case XK_KP_Multiply:
|
case XK_KP_Multiply:
|
||||||
case XK_asterisk:
|
case XK_asterisk:
|
||||||
|
case XK_comma:
|
||||||
key_event(BUTTON_MUL, xev);
|
key_event(BUTTON_MUL, xev);
|
||||||
wake = 1;
|
wake = 1;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue