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

@@ -1,57 +1,42 @@
version: 43 version: 43
jobs: jobs:
- name: Build for x86_64 - name: Build for x86_64
steps: steps:
- type: CheckoutStep - type: CheckoutStep
name: Checkout name: Checkout
cloneCredential: cloneCredential:
type: DefaultCredential type: DefaultCredential
withLfs: true withLfs: true
withSubmodules: false withSubmodules: false
condition: SUCCESSFUL condition: SUCCESSFUL
optional: false optional: false
- type: CommandStep - type: BuildImageStep
name: Execute build name: Build Docker Image
runInContainer: true dockerfile: Dockerfile
image: onedev.site.tesses.net/tesses-framework/tesses-framework:latest output:
interpreter: type: RegistryOutput
type: DefaultInterpreter tags: onedev.site.tesses.net/crosslang/crosslang:latest onedev.site.tesses.net/crosslang/crosslang:@commit_hash@
commands: | registryLogins:
mkdir build - registryUrl: "@server_url@"
cd build userName: "@job_token@"
cmake -S .. -B . -DCROSSLANG_FETCHCONTENT=OFF passwordSecret: dockersecret
make -j12 platforms: linux/amd64
make install DESTDIR=../out condition: SUCCESSFUL
useTTY: true optional: false
condition: SUCCESSFUL triggers:
optional: false - type: DependencyFinishedTrigger
- type: BuildImageStep projects: tesses-framework
name: Build Docker Image - type: BranchUpdateTrigger
dockerfile: Dockerfile.run branches: master
output: userMatch: anyone
type: RegistryOutput projects: crosslang
tags: onedev.site.tesses.net/crosslang/crosslang:latest onedev.site.tesses.net/crosslang/crosslang:@commit_hash@ projectDependencies:
registryLogins: - projectPath: tesses-framework
- registryUrl: '@server_url@' buildProvider:
userName: '@job_token@' type: LastFinishedBuild
passwordSecret: dockersecret jobName: Build for x86_64
platforms: linux/amd64 artifacts: "*"
condition: SUCCESSFUL retryCondition: never
optional: false maxRetries: 3
triggers: retryDelay: 30
- type: DependencyFinishedTrigger timeout: 14400
projects: tesses-framework
- type: BranchUpdateTrigger
branches: master
userMatch: anyone
projects: crosslang
projectDependencies:
- projectPath: tesses-framework
buildProvider:
type: LastFinishedBuild
jobName: Build for x86_64
artifacts: '*'
retryCondition: never
maxRetries: 3
retryDelay: 30
timeout: 14400

View File

@@ -1,8 +1,17 @@
FROM onedev.site.tesses.net/tesses-framework/tesses-framework:latest FROM alpine:latest AS build
RUN apt update -y && \
apt install -y --no-install-recommends \ RUN apk update
libjansson-dev wget && \ RUN apk add --no-cache cmake g++ make git
apt clean -y && \
rm -rf /var/lib/apt/lists/* COPY ./ /src
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 /
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 /