diff --git a/fann-builder/Dockerfile b/fann-builder/Dockerfile index 836832d..fdcde02 100644 --- a/fann-builder/Dockerfile +++ b/fann-builder/Dockerfile @@ -1,12 +1,11 @@ FROM alpine:latest -# Install all necessary tools: git, musl-gcc (which is just gcc in Alpine), make +# Install all necessary tools: git, build tools RUN apk add --no-cache \ git \ - build-base \ - musl-dev + build-base -# Create a non-root user to run the build (best practice) +# Create a non-root user to run the build RUN adduser -D builder USER builder WORKDIR /home/builder diff --git a/fann-builder/build.sh b/fann-builder/build.sh index 0f09163..89ce3e5 100644 --- a/fann-builder/build.sh +++ b/fann-builder/build.sh @@ -1,18 +1,15 @@ #!/bin/sh -# Clone the specific FANN version you want (e.g., latest from master) +# Clone the specific FANN version you want git clone https://github.com/libfann/fann.git cd fann/src -# Build the library exactly as you specified -musl-gcc -c -O2 -fPIC -I../src/include -DDISABLE_PARALLEL_FANN -o floatfann.o floatfann.c -musl-gcc -c -O2 -fPIC -I../src/include -DDISABLE_PARALLEL_FANN -o doublefann.o doublefann.c -musl-gcc -c -O2 -fPIC -I../src/include -DDISABLE_PARALLEL_FANN -o fixedfann.o fixedfann.c +# Build the library with gcc (which uses musl in Alpine) +gcc -c -O2 -fPIC -I../src/include -DDISABLE_PARALLEL_FANN -o floatfann.o floatfann.c +gcc -c -O2 -fPIC -I../src/include -DDISABLE_PARALLEL_FANN -o doublefann.o doublefann.c +gcc -c -O2 -fPIC -I../src/include -DDISABLE_PARALLEL_FANN -o fixedfann.o fixedfann.c ar rcs libfann.a floatfann.o doublefann.o fixedfann.o -# Copy the crucial artifacts to a folder called 'output' -# TeamCity will look for files in the working directory after the build. -cp libfann.a ~/output/ -cp ../src/include/fann.h ~/output/ - -echo "Build complete! Artifacts are in the 'output' directory." \ No newline at end of file +# Copy artifacts to the output directory in the home folder +cp libfann.a /home/builder/output/ +cp ../src/include/fann.h /home/builder/output/ \ No newline at end of file