4747# To debug build problems, add the flag `--build-arg VERBOSE=true` when building the image to
4848# have it print all output from each download and compilation step.
4949# NOTE: If you are using the latest Docker versions with buildx, you'll also need to increase
50- # the log limit (https://github.com/docker/buildx/issues/484) and add the flag `--progress=plain`
50+ # the log limit (https://github.com/docker/buildx/issues/484) and add optionally include
51+ # the flag `--progress=plain` if you want to see the full output.
5152ARG VERBOSE=false
5253
5354# For maximum speed, set this to the number of CPU threads you have
@@ -108,65 +109,65 @@ RUN if [ "$THREADS" -eq 0 ] 2>/dev/null; then \
108109 printf "export DOCKER_THREADS=$(getconf _NPROCESSORS_ONLN)\n " >> /tmp/dockerenv.sh; \
109110 elif ! [[ -z "${THREADS//[0-9]}" ]]; then \
110111 # If THREADS is a negative number or any non-integer, print an error and exit
111- printf "Invalid THREADS specified, please enter a positive integer value\n " ; >&2; \
112+ printf "Invalid THREADS specified, please enter a positive integer value\n " ; \
112113 exit 1; \
113114 else \
114115 # If THREADS is a positive integer, use that value
115116 printf "export DOCKER_THREADS=$THREADS\n " >> /tmp/dockerenv.sh; \
116117 fi \
117118 && . /tmp/dockerenv.sh \
118- && printf "Building using $DOCKER_THREADS threads\n " >&2
119+ && printf "Building using $DOCKER_THREADS threads\n "
119120
120121# Build KOS and patched GCC cross-compiler toolchain for SH4 (Main CPU) and ARM7DI (AICA Control CPU)
121122RUN \
122123 # Clone repositories
123124 . /tmp/dockerenv.sh \
124- && printf "Cloning latest mainline KOS...$NL" >&2 \
125+ && printf "Cloning latest mainline KOS...$NL" \
125126 && git clone --single-branch --branch $KOS_BRANCH $KOS_REPO $KOS &> $REDIRECT \
126- && printf "Done.\n Cloning latest mainline KOS PORTS...$NL" >&2 \
127+ && printf "Done.\n Cloning latest mainline KOS PORTS...$NL" \
127128 && git clone --single-branch --branch $PORTS_BRANCH $PORTS_REPO $PORTS &> $REDIRECT \
128- && printf "Done.\n " >&2
129+ && printf "Done.\n "
129130RUN \
130131 # Configure environment
131132 . /tmp/dockerenv.sh \
132- && printf "Configuring environment...$NL" >&2 \
133+ && printf "Configuring environment...$NL" \
133134 && cp $KOS/doc/environ.sh.sample $KOS/environ.sh \
134135 # NOTE: This is in single quotes on purpose so that ${KOS_BASE} is not evaluated
135136 && printf '. ${KOS_BASE}/environ_dreamcast.sh' >> $KOS/environ.sh \
136137 # NOTE: This is in double quotes on purpose so that $KOS is evaluated
137138 && printf ". /etc/profile\n . $KOS/environ.sh\n " > /root/.bashrc \
138- && printf "Done.\n " >&2
139+ && printf "Done.\n "
139140RUN \
140141 # Build KOS
141142 . /tmp/dockerenv.sh && . $KOS/environ.sh \
142- && printf "Building KOS...$NL" >&2 \
143+ && printf "Building KOS...$NL" \
143144 && make -j$DOCKER_THREADS -C $KOS &> $REDIRECT \
144- && printf "Done.\n Cleaning KOS...$NL" >&2 \
145+ && printf "Done.\n Cleaning KOS...$NL" \
145146 && make -j$DOCKER_THREADS -C $KOS clean &> $REDIRECT \
146- && printf "Done.\n " >&2
147+ && printf "Done.\n "
147148RUN \
148149 # Build KOS Ports
149150 . /tmp/dockerenv.sh && . $KOS/environ.sh \
150- && printf "Building KOS Ports...$NL" >&2 \
151+ && printf "Building KOS Ports...$NL" \
151152 && make -C $KOS kos-ports_all &> $REDIRECT \
152- && printf "Done.\n Cleaning KOS Ports...$NL" >&2 \
153+ && printf "Done.\n Cleaning KOS Ports...$NL" \
153154 && make -C $KOS kos-ports_clean &> $REDIRECT \
154- && printf "Done.\n " >&2
155+ && printf "Done.\n "
155156RUN \
156157 # Build KOS addons
157158 . /tmp/dockerenv.sh && . $KOS/environ.sh \
158- && printf "Building KOS addons...$NL" >&2 \
159+ && printf "Building KOS addons...$NL" \
159160 && make -j$DOCKER_THREADS -C $KOS/addons &> $REDIRECT \
160- && printf "Done.\n Cleaning KOS addons...$NL" >&2 \
161+ && printf "Done.\n Cleaning KOS addons...$NL" \
161162 && find $KOS/addons -name "*.o" -delete \
162- && printf "Done.\n " >&2
163+ && printf "Done.\n "
163164RUN \
164165 # Build extra included utilities
165166 . /tmp/dockerenv.sh && . $KOS/environ.sh \
166- && printf "Building extra included utilities...$NL" >&2 \
167+ && printf "Building extra included utilities...$NL" \
167168 && sed -i 's/^DIRS.*/DIRS = bin2c bincnv dcbumpgen genromfs isotest kmgenc makejitter rdtest scramble vqenc wav2adpcm/' $KOS/utils/Makefile \
168169 && make -j$DOCKER_THREADS -C $KOS/utils &> $REDIRECT \
169- && printf "Done.\n Symlinking extra utilities to $DCTOOLCHAIN/bin so they're in the PATH...$NL" >&2 \
170+ && printf "Done.\n Symlinking extra utilities to $DCTOOLCHAIN/bin so they're in the PATH...$NL" \
170171 && mkdir -p $DCTOOLCHAIN/bin \
171172 && ln -s $KOS/utils/bin2c/bin2c $DCTOOLCHAIN/bin/bin2c \
172173 && ln -s $KOS/utils/bin2o/bin2o $DCTOOLCHAIN/bin/bin2o \
@@ -182,13 +183,13 @@ RUN \
182183 && ln -s $KOS/utils/scramble/scramble $DCTOOLCHAIN/bin/scramble \
183184 && ln -s $KOS/utils/vqenc/vqenc $DCTOOLCHAIN/bin/vqenc \
184185 && ln -s $KOS/utils/wav2adpcm/wav2adpcm $DCTOOLCHAIN/bin/wav2adpcm \
185- && printf "Done.\n Cleaning extra included utilities...$NL" >&2 \
186+ && printf "Done.\n Cleaning extra included utilities...$NL" \
186187 && find $KOS/utils -name "*.o" -delete \
187- && printf "Done.\n " >&2
188+ && printf "Done.\n "
188189RUN \
189190 # Build extra external utilities
190191 . /tmp/dockerenv.sh && . $KOS/environ.sh \
191- && printf "Building extra external utilities...$NL" >&2 \
192+ && printf "Building extra external utilities...$NL" \
192193 && mkdir -p $KOS/utils/makeip \
193194 && cd $KOS/utils/makeip \
194195 && curl --progress-bar -O http://www.boob.co.uk/files/makeip.tar.gz &> $REDIRECT \
@@ -197,25 +198,24 @@ RUN \
197198 && gcc makeip.c -o makeip &> $REDIRECT \
198199 && ln -s $KOS/utils/makeip/makeip $DCTOOLCHAIN/bin/makeip \
199200 && cd $KOS/utils \
200- && git clone https://github.com/Kazade /img4dc.git &> $REDIRECT \
201+ && git clone https://github.com/einsteinx2 /img4dc.git &> $REDIRECT \
201202 && cd $KOS/utils/img4dc \
202203 && cmake . &> $REDIRECT \
203- && make BUMP=9 &> $REDIRECT \
204+ && make cdi4dc &> $REDIRECT \
204205 && ln -s $KOS/utils/img4dc/cdi4dc/cdi4dc $DCTOOLCHAIN/bin/cdi4dc \
205- && ln -s $KOS/utils/img4dc/mds4dc/mds4dc $DCTOOLCHAIN/bin/mds4dc \
206206 && cd $KOS/utils \
207207 && git clone https://github.com/sizious/dcload-ip.git &> $REDIRECT \
208208 && cd $KOS/utils/dcload-ip \
209209 && make install \
210- && printf "Done.\n " >&2
210+ && printf "Done.\n "
211211RUN \
212212 # Prepare files to copy in next stage
213213 . /tmp/dockerenv.sh \
214- && printf "Preparing files to copy to next stage...$NL" >&2 \
214+ && printf "Preparing files to copy to next stage...$NL" \
215215 && mkdir /tmp/copy \
216216 && mv $DCTOOLCHAIN/sh-elf $DCTOOLCHAIN/arm-eabi $DCTOOLCHAIN/kos $DCTOOLCHAIN/kos-ports $DCTOOLCHAIN/bin /tmp/copy \
217217 && mv /tmp/dockerenv.sh /root/.bashrc /tmp/copy \
218- && printf "Done.\n " >&2
218+ && printf "Done.\n "
219219
220220#
221221# Second stage: Final Alpine image with the GCC cross-compiler toolchain, KOS, KOS-PORTS, Addons, Utils, and some other useful stuff
@@ -241,19 +241,19 @@ RUN \
241241 && mv $DCTOOLCHAIN/.bashrc /root/.bashrc \
242242\
243243 # Install useful tools for building Dreamcast projects
244- && printf "Installing useful tools for building Dreamcast projects...$NL" >&2 \
244+ && printf "Installing useful tools for building Dreamcast projects...$NL" \
245245 && apk --update add --no-cache \
246- bash bison bzip2 cdrkit cmake colordiff curl flex gawk git linux-headers \
246+ bash bison bzip2 cdrkit cmake colordiff coreutils curl flex gawk git linux-headers \
247247 musl-dev make patch python2 sed subversion tar texinfo tree vim wget &> $REDIRECT \
248248 && apk --update add --no-cache libelf-dev --repository=http://dl-cdn.alpinelinux.org/alpine/v3.9/main \
249249 && rm -rf /var/cache/apk/* \
250- && printf "Done.\n " >&2 \
250+ && printf "Done.\n " \
251251\
252252 # Create entry point script to automatically load KOS environment
253- && printf "Create entry point script to automatically load KOS environment...$NL" >&2 \
253+ && printf "Create entry point script to automatically load KOS environment...$NL" \
254254 && printf '#!/bin/bash\n . /opt/toolchains/dc/kos/environ.sh\n exec "$@"' > /usr/local/bin/entry.sh \
255255 && chmod a+x /usr/local/bin/entry.sh \
256- && printf "Done.\n " >&2
256+ && printf "Done.\n "
257257
258258# Default to /src directory
259259WORKDIR /src
0 commit comments