mirror of
https://github.com/EndPositive/slipstream.git
synced 2025-10-08 12:25:04 +00:00
Add Dockerfile
This commit is contained in:
parent
9d309d48b1
commit
72eed3c2bb
3 changed files with 36 additions and 2 deletions
7
.dockerignore
Normal file
7
.dockerignore
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
*
|
||||
!certs/
|
||||
!src/
|
||||
!extern/
|
||||
!include/
|
||||
!src/
|
||||
!CMakeLists.txt
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 3.30)
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project(slipstream C)
|
||||
|
||||
set(CMAKE_C_STANDARD 23)
|
||||
|
|
@ -17,6 +17,9 @@ set(BUILD_TESTING OFF)
|
|||
|
||||
set(PICOQUIC_ADDITIONAL_C_FLAGS "" CACHE STRING "Additional C flags for picoquic")
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE)
|
||||
endif()
|
||||
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
||||
list(APPEND PICOQUIC_ADDITIONAL_C_FLAGS -Og)
|
||||
list(APPEND PICOQUIC_ADDITIONAL_CXX_FLAGS -Og)
|
||||
|
|
@ -24,7 +27,7 @@ if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
|||
else()
|
||||
list(APPEND PICOQUIC_ADDITIONAL_C_FLAGS -O3)
|
||||
list(APPEND PICOQUIC_ADDITIONAL_CXX_FLAGS -O3)
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
add_subdirectory(extern/picoquic)
|
||||
|
||||
|
|
|
|||
24
Dockerfile
Normal file
24
Dockerfile
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
FROM debian:bookworm-slim AS builder
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# apt update without cache and install build-essential and cmake
|
||||
RUN apt-get update && apt-get install -y build-essential cmake git pkg-config libssl-dev
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN --mount=type=cache,target=/usr/src/app/cmake-cache \
|
||||
cmake -Bcmake-cache -H. && \
|
||||
cmake --build cmake-cache --target slipstream && mv cmake-cache/slipstream .
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
RUN apt-get update && apt-get install -y libssl3
|
||||
|
||||
COPY ./certs/ ./certs/
|
||||
|
||||
COPY --from=builder /usr/src/app/slipstream .
|
||||
|
||||
CMD ["/usr/src/app/slipstream"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue