Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 30 additions & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
FROM phusion/baseimage:master-amd64

LABEL maintainer="Georgios Sokianos <walkero@gmail.com>"

# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]
FROM ubuntu:22.04
WORKDIR /usr/src

RUN dpkg --add-architecture i386; \
apt-get update && apt-get -y install \
autoconf ccache make mmake automake cmake \
RUN apt-get -y update
RUN apt-get -y install \
autoconf \
automake \
bison \
byacc \
bzip2 \
cmake \
flex \
gawk \
gcc \
wget \
lhasa \
git subversion mercurial \
gawk bison flex netpbm genisoimage sshpass \
python-mako libswitch-perl gperf gcc-multilib g++ \
patch bzip2 ca-certificates xz-utils \
libpng-dev zlib1g-dev libxcursor-dev libgl1-mesa-dev libasound2-dev \
libx11-dev libxext-dev libc6-dev liblzo2-dev libxxf86vm-dev libsdl1.2-dev byacc libxxf86vm1:i386; \
ln -s /usr/bin/genisoimage /usr/bin/mkisofs; \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*;
genisoimage \
git \
g++ \
libc6-dev \
liblzo2-dev \
libpng-dev \
libsdl1.2-dev \
libx11-dev \
libxcursor-dev \
libxext-dev \
libxxf86vm-dev \
make \
mmake \
netpbm \
wget
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Add git branch name to bash prompt
RUN sed -i '4c\'"\nparse_git_branch() {\n\
git branch 2> /dev/null | sed -e \'/^[^*]/d\' -e \'s/* \\\(.*\\\)/ (\\\1)/\'\n\
}\n" ~/.bashrc; \
sed -i '43c\'"force_color_prompt=yes" ~/.bashrc; \
sed -i '57c\'" PS1=\'\${debian_chroot:+(\$debian_chroot)}\\\[\\\033[01;32m\\\]\\\u@\\\h\\\[\\\033[00m\\\]:\\\[\\\033[01;34m\\\]\\\w\\\[\\\033[01;31m\\\]\$(parse_git_branch)\\\[\\\033[00m\\\]\\\$ '" ~/.bashrc; \
sed -i '59c\'" PS1=\'\${debian_chroot:+(\$debian_chroot)}\\\u@\\\h:\\\w \$(parse_git_branch)\$ \'" ~/.bashrc;
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /usr/src
CMD ["/bin/bash"]
13 changes: 4 additions & 9 deletions docker.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
#!/bin/bash
#sudo docker run -it --rm -v "$PWD":/git ubuntu "/bin/bash -c \"apt-get install git-core gcc g++ make cmake gawk bison flex bzip2 netpbm autoconf automake libx11-dev libxext-dev libc6-dev liblzo2-dev libxxf86vm-dev libpng-dev libsdl1.2-dev byacc python-mako libxcursor-dev gcc-multilib\"; /bin/bash"
IMAGE_NAME=apolloos/builder

IMAGE_NAME=apollo-os-build:latest

#Do we have this image already?
DOCKER_IMAGE_COUNT=$(docker image ls | awk -F\ '{ print $1 }' | grep "${IMAGE_NAME} | wc -l")
echo ${DOCKER_IMAGE_COUNT}
if [ "${DOCKER_IMAGE_COUNT}" == "" ]
if [ -z "$(docker images -q "${IMAGE_NAME}")" ]
then
docker build -t ${IMAGE_NAME} .
docker build -t "${IMAGE_NAME}" .
fi

#Run the docker and start the build
docker run -it --rm -v "$PWD":/usr/src ${IMAGE_NAME} /bin/bash -c "cd /usr/src; ./rebuild_all.sh"
docker run -it --rm -v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro -v "${PWD}":/usr/src -u "$(id -u):$(id -g)" "${IMAGE_NAME}" /bin/bash -c "./mkapollo.sh --ports=/usr/src/bin/Sources all"
10 changes: 9 additions & 1 deletion mkapollo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ DEBUG=0
CONFO=""
MAKEO=""
EXCLUDE=0
PORTS=""
## END Configuration ##

## BEGIN Beauty Variables ##
Expand All @@ -48,7 +49,9 @@ setvars () {
SRC="${DIR}/${WORK}/src"
fi
TEST_CFLAGS="" #-I${DIR}/${WORK}"
PORTS="${DIR}/${WORK}/prt"
if [ -z "${PORTS}" ]; then
PORTS="${DIR}/${WORK}/prt"
fi
BIN="${DIR}/${WORK}/bin"
source ${SRC}/make_dist_config.sh
DISTOPTNAME="--enable-dist-name=${DISTRONAME}"
Expand Down Expand Up @@ -210,6 +213,10 @@ for i in "$@"; do
REZ="640x256x4"
shift
;;
--ports=*)
PORTS="${i#*=}"
shift
;;
-v|-v1|--vamp)
VAMP=1
shift
Expand Down Expand Up @@ -290,6 +297,7 @@ ${BOLD}mkapollo.sh -- Roll your own ApolloOS image and ROM${NC}
-n,--ntsc Select NTSC build
-o,--opt=# Select optimization level
-p,--pal Select PAL build
--ports Select ports directory
-v,--vamp Compile for True Vampires
-w,--work=<dir> Work directory (will be created if not present)
-x,--exclude When wiping, do not save cross compile tools
Expand Down