-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/centos-tests' into develop
- Loading branch information
Showing
6 changed files
with
127 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
ARG centos_version=centos8 | ||
ARG factorio_version=1.0.0 | ||
ARG factorio_user=factorio | ||
|
||
### A base image without test resources: | ||
FROM centos:$centos_version AS sans-test-resources | ||
ARG factorio_user | ||
RUN yum update -y && \ | ||
yum install -y \ | ||
wget && \ | ||
yum clean all && \ | ||
rm -rf /var/cache/yum | ||
RUN useradd $factorio_user | ||
USER $factorio_user | ||
WORKDIR /opt/factorio-init | ||
ENTRYPOINT ["bash", "/opt/factorio-init/extras/test/libs/bats-core/bin/bats"] | ||
|
||
### Build onto the base, add test resources: | ||
FROM sans-test-resources AS with-test-resources | ||
ARG factorio_version | ||
ENV FACTORIO_INIT_WITH_TEST_RESOURCES=1 | ||
RUN wget -O /tmp/factorio_headless_x64_${factorio_version}.tar.xz \ | ||
https://factorio.com/get-download/${factorio_version}/headless/linux64 | ||
|
||
### Build onto the with-test-resources for alternate glibc (for centos7 testing) | ||
FROM with-test-resources AS with-glibc-sidebyside | ||
ARG factorio_user | ||
USER root | ||
RUN yum groupinstall -y \ | ||
"Development tools" && \ | ||
yum install -y \ | ||
glibc-devel.i686 \ | ||
glibc.i686 && \ | ||
yum clean all && \ | ||
rm -rf /var/cache/yum | ||
WORKDIR /tmp | ||
RUN wget -q http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz -O - |tar -xvz | ||
WORKDIR /tmp/glibc-2.18/glibc-build | ||
RUN ../configure --prefix='/opt/glibc-2.18' && \ | ||
sed -i -e 's#if (/$ld_so_name/) {#if (/\Q$ld_so_name\E/) {#' \ | ||
../scripts/test-installation.pl && \ | ||
make && \ | ||
make install # these take a while (~5 minutes on a i5 3.5GHz 32GB RAM WSL2 box) | ||
USER $factorio_user | ||
ENV FACTORIO_INIT_ALT_GLIBC=1 | ||
WORKDIR /opt/factorio-init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters