Add dockerfile
CMake / build (push) Failing after 35s

This commit is contained in:
2025-02-28 11:15:37 +01:00
parent 9ea6089327
commit bfd1f305e8
5 changed files with 26 additions and 6 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
# Project exclude paths
/cmake-build-debug/
/.idea/
/.idea/
build
+7 -1
View File
@@ -1,6 +1,12 @@
cmake_minimum_required(VERSION 3.19)
project(qotd C)
message("STATIC_BUILD=${STATIC_BUILD}")
set(CMAKE_C_STANDARD 99)
add_executable(qotd main.c quote.c quote.h server.c server.h config.h)
add_executable(qotd main.c quote.c quote.h server.c server.h config.h)
if ( STATIC_BUILD )
target_link_libraries(qotd -static)
endif()
+12
View File
@@ -0,0 +1,12 @@
FROM git.legonzaur.fr/legonzaur/qotd/builder:latest AS builder
WORKDIR /opt/builder
COPY . .
RUN cmake -B build -DSTATIC_BUILD=true
WORKDIR build
RUN make
FROM alpine
COPY --from=builder /opt/builder/build/qotd /
ENTRYPOINT ["/qotd"]
+3
View File
@@ -0,0 +1,3 @@
FROM alpine:latest
RUN apk add --no-cache cmake make gcc musl-dev
+2 -4
View File
@@ -8,13 +8,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <bits/types/FILE.h>
#include <bits/types/struct_FILE.h>
void getRandomQuote(char quote[2048]);
void getQuote(long line, char quote[2048]);
int getFileLineCount(char* filename);
int getFileLineCount(char *filename);
#endif //QOTD_QUOTE_H
#endif // QOTD_QUOTE_H