Use alpine for Docker

This commit is contained in:
2026-04-16 22:18:53 -05:00
parent 66f5b704ee
commit 7badbeb217
3 changed files with 57 additions and 65 deletions

View File

@@ -10,30 +10,15 @@ jobs:
withSubmodules: false
condition: SUCCESSFUL
optional: false
- type: CommandStep
name: Execute build
runInContainer: true
image: onedev.site.tesses.net/tesses-framework/tesses-framework:latest
interpreter:
type: DefaultInterpreter
commands: |
mkdir build
cd build
cmake -S .. -B . -DCROSSLANG_FETCHCONTENT=OFF
make -j12
make install DESTDIR=../out
useTTY: true
condition: SUCCESSFUL
optional: false
- type: BuildImageStep
name: Build Docker Image
dockerfile: Dockerfile.run
dockerfile: Dockerfile
output:
type: RegistryOutput
tags: onedev.site.tesses.net/crosslang/crosslang:latest onedev.site.tesses.net/crosslang/crosslang:@commit_hash@
registryLogins:
- registryUrl: '@server_url@'
userName: '@job_token@'
- registryUrl: "@server_url@"
userName: "@job_token@"
passwordSecret: dockersecret
platforms: linux/amd64
condition: SUCCESSFUL
@@ -50,7 +35,7 @@ jobs:
buildProvider:
type: LastFinishedBuild
jobName: Build for x86_64
artifacts: '*'
artifacts: "*"
retryCondition: never
maxRetries: 3
retryDelay: 30

View File

@@ -1,8 +1,17 @@
FROM onedev.site.tesses.net/tesses-framework/tesses-framework:latest
RUN apt update -y && \
apt install -y --no-install-recommends \
libjansson-dev wget && \
apt clean -y && \
rm -rf /var/lib/apt/lists/*
RUN mkdir /src && cd /src && git clone https://onedev.site.tesses.net/crosslang . && cd /src && mkdir build && cd build && cmake -S .. -B . && make -j4 && make install && cd / && rm -r /src
WORKDIR /
FROM alpine:latest AS build
RUN apk update
RUN apk add --no-cache cmake g++ make git
COPY ./ /src
RUN cd /src && mkdir build && cd build && cmake -S .. -B . -DTESSESFRAMEWORK_ENABLE_EXAMPLES=OFF -DTESSESFRAMEWORK_ENABLE_APPS=ON -DCMAKE_BUILD_TYPE=Release && make -j`nproc` && make install DESTDIR=/out
FROM alpine:latest
RUN apk update
RUN apk add --no-cache libstdc++
COPY --from=build /out/usr /usr
ENV CROSSLANG_CONTAINER=1
ENTRYPOINT ["/usr/local/bin/crossint"]

View File

@@ -1,2 +0,0 @@
FROM onedev.site.tesses.net/tesses-framework/tesses-framework:latest
COPY out /