Skip to content

Commit 47eacc2

Browse files
authored
Use alpine to build all containers (the-benchmarker#1968)
1 parent 528688b commit 47eacc2

File tree

93 files changed

+748
-852
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+748
-852
lines changed

.gitignore

-11
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,11 @@
33
.DS_Store
44
*.swp
55

6-
# Lock files
7-
*.lock
8-
9-
# Crystal
10-
lib/
11-
.shards/
12-
bin/
13-
146
.neph
157

168
# git temporary files
179
*.orig
1810

19-
# PHP
20-
vendor/
21-
2211
# GoLand IDE
2312
.idea
2413

PULL_REQUEST_TEMPLATE.md

-22
This file was deleted.

c/Dockerfile

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
FROM gcc:9.2
1+
FROM alpine
22

3-
ENV DEBIAN_FRONTEND=noninteractive
3+
RUN apk add build-base
44

5-
WORKDIR /usr/src/app
5+
{{#build_deps}}
6+
RUN apk add {{{.}}}
7+
{{/build_deps}}
68

7-
RUN apt-get -qq update && \
8-
apt-get -qy install cmake {{#deps}} {{{.}}} {{/deps}}
9+
WORKDIR /usr/src/app
910

1011
COPY . ./
1112

@@ -17,12 +18,10 @@ COPY . ./
1718
RUN {{{.}}}
1819
{{/build}}
1920

20-
FROM debian
21+
FROM alpine
2122

22-
ENV DEBIAN_FRONTEND=noninteractive
23-
RUN apt-get -qq update
2423
{{#bin_deps}}
25-
RUN apt-get -qy install {{{.}}}
24+
RUN apk add {{{.}}}
2625
{{/bin_deps}}
2726

2827
{{#files}}

c/agoo-c/config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ provider:
77
language: 11
88

99
clone:
10-
- wget -c https://github.com/ohler55/agoo-c/tarball/v0.7.0 -O agoo.tar.gz
10+
- wget -c https://github.com/ohler55/agoo-c/tarball/v0.7.3 -O agoo.tar.gz
1111
- tar xzf agoo.tar.gz
1212
- mv ohler55* agoo-c
1313
- cd /usr/src/app/agoo-c/src && make

c/agoo-c/simple.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ int main(int argc, char **argv) {
3636
// to work pretty well on a 4 core (8 processor) machine. It is the ratio of
3737
// thread to processors.
3838
agoo_io_loop_ratio = 1.0;
39-
39+
agoo_poll_wait = 0.01;
40+
4041
if (AGOO_ERR_OK != agoo_init(&err, "simple")) {
4142
printf("Failed to initialize Agoo. %s\n", err.msg);
4243
return err.code;

c/kore/config.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ clone:
1313
build:
1414
- cd hello && kodev build
1515

16+
build_deps:
17+
- bsd-compat-headers
18+
- libressl-dev
19+
1620
bin_deps:
17-
- libssl1.1
21+
- libressl
1822

1923
files:
2024
- ../../local/bin/kore

clojure/Dockerfile

+21-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1-
FROM clojure:tools-deps
1+
FROM clojure:openjdk-14-tools-deps-1.10.1.478-alpine
22

3-
WORKDIR /coast
3+
WORKDIR /usr/src/app
44

5-
COPY . /coast
5+
COPY . ./
66

7-
ENV COAST_ENV=prod
7+
{{#build_deps}}
8+
RUN apk add {{{.}}}
9+
{{/build_deps}}
810

911
RUN clojure -Auberjar
1012

11-
CMD java -jar coast.jar 3000
13+
FROM openjdk:alpine
14+
15+
WORKDIR /opt/bin
16+
17+
{{#environment}}
18+
ENV {{{.}}}
19+
{{/environment}}
20+
21+
{{#files}}
22+
COPY --from=0 /usr/src/app/{{{.}}} /opt/bin/{{{.}}}
23+
{{/files}}
24+
25+
{{#command}}
26+
CMD {{{.}}}
27+
{{/command}}

clojure/coast/.gitignore

-15
This file was deleted.

clojure/coast/config.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
framework:
22
website: coastonclojure.com
33
version: 1.0
4+
5+
environment:
6+
COAST_ENV: prod
7+
8+
build_deps:
9+
- bash
10+
11+
files:
12+
- coast.jar
13+
14+
command: java -jar coast.jar 3000

cpp/Dockerfile

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
FROM gcc:9.2
1+
FROM alpine
22

3-
ENV DEBIAN_FRONTEND=noninteractive
3+
RUN apk add git build-base cmake
44

55
WORKDIR /usr/src/app
66

7-
RUN apt-get -qq update && \
8-
apt-get -qy install cmake {{#deps}} {{{.}}} {{/deps}}
7+
{{#build_deps}}
8+
RUN apk add {{{.}}}
9+
{{/build_deps}}
910

1011
COPY . ./
1112

@@ -17,16 +18,14 @@ COPY . ./
1718
RUN {{{.}}}
1819
{{/build}}
1920

20-
FROM debian
21+
FROM alpine
2122

22-
ENV DEBIAN_FRONTEND=noninteractive
23-
RUN apt-get -qq update
2423
{{#bin_deps}}
25-
RUN apt-get -qy install {{{.}}}
24+
RUN apk add {{{.}}}
2625
{{/bin_deps}}
2726

2827
{{#files}}
29-
COPY --from=0 /usr/src/app/{{.}} /usr/bin/{{{.}}}
28+
COPY --from=0 /usr/src/app/{{.}} /usr/bin/{{{.}}}
3029
{{/files}}
3130

3231
{{#command}}

cpp/config.yaml

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
provider:
22
default:
3-
language: 11
4-
5-
build:
6-
- cmake -H. -B_builds -DCMAKE_BUILD_TYPE=Release
7-
- cmake --build _builds --config Release
8-
9-
command: _builds/server_cpp_evhtp
3+
language: 11

cpp/drogon/config.yaml

+9-9
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ provider:
66
default:
77
language: 14/17
88

9-
deps:
10-
- libjsoncpp-dev
11-
- uuid-dev
12-
- libssl-dev
13-
- zlib1g-dev
9+
build_deps:
10+
- jsoncpp-dev
11+
- util-linux-dev
12+
- libressl-dev
13+
- zlib-dev
1414

1515
bin_deps:
16-
- libjsoncpp1
17-
- uuid
18-
- libssl1.1
19-
- zlib1g
16+
- jsoncpp
17+
- libuuid
18+
- libressl
19+
- zlib
2020

2121
clone:
2222
- git clone --branch v1.0.0-beta11 https://github.com/an-tao/drogon

cpp/evhtp/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.1)
22

33
include("cmake/HunterGate.cmake")
44
HunterGate(
5-
URL "https://github.com/ruslo/hunter/archive/v0.20.32.tar.gz"
6-
SHA1 "72bd88df338cb1b02d4c36c3f85ac87b33578eab"
5+
URL "https://github.com/cpp-pm/hunter/archive/v0.23.224.tar.gz"
6+
SHA1 "18e57a43efc435f2e1dae1291e82e42afbf940be"
77
)
88

99
project(server_cpp_evhtp)

cpp/evhtp/config.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ framework:
22
website: criticalstack/libevhtp
33
version: 1.2
44

5+
build_deps:
6+
- libevent-dev
7+
- perl
8+
- linux-headers
9+
- bsd-compat-headers
10+
11+
bin_deps:
12+
- libstdc++
13+
514
build:
615
- cmake -H. -B_builds -DCMAKE_BUILD_TYPE=Release
716
- cmake --build _builds --config Release

crystal/Dockerfile

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM jrei/crystal-alpine
1+
FROM jrei/crystal-alpine:0.31.1
22

33
WORKDIR /usr/src/app
44

@@ -7,10 +7,13 @@ COPY . ./
77
RUN shards install
88
RUN shards build --production --release --no-debug --static
99

10-
FROM alpine
10+
FROM alpine
11+
1112
COPY --from=0 /usr/src/app/bin/server /usr/bin/app
13+
1214
{{#files}}
1315
COPY --from=0 /usr/src/app/{{.}} /usr/bin/{{{.}}}
1416
{{/files}}
17+
1518
WORKDIR /usr/bin
1619
CMD ./app
-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
abstract class ApiAction < Lucky::Action
2-
32
accepted_formats [:html, :json], default: :html
4-
53
end
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
abstract class BrowserAction < Lucky::Action
22
include Lucky::ProtectFromForgery
3-
3+
44
default_format :html
55
end

csharp/Dockerfile

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
FROM microsoft/dotnet:2.2-sdk AS build
2-
WORKDIR /app
1+
FROM mcr.microsoft.com/dotnet/core/sdk:3.0-alpine
2+
3+
WORKDIR /usr/src/app
34

45
# copy csproj and restore as distinct layers
56
COPY *.csproj .
@@ -9,11 +10,13 @@ RUN dotnet restore
910
COPY . .
1011
RUN dotnet publish -c release -o out
1112

12-
FROM microsoft/dotnet:2.2-aspnetcore-runtime AS runtime
13-
WORKDIR /app
14-
COPY --from=build /app/out ./
13+
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-alpine
14+
15+
WORKDIR /usr/src/app
16+
17+
COPY --from=0 /usr/src/app/out out
1518

1619
ENV ASPNETCORE_URLS http://*:3000
1720
ENV COMPlus_TieredCompilation 1
1821

19-
ENTRYPOINT ["dotnet", "aspnetcore.dll"]
22+
CMD dotnet /usr/src/app/out/aspnetcore.dll

csharp/aspnetcore/aspnetcore.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.2</TargetFramework>
4+
<TargetFramework>netcoreapp3.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.*"/>
8+
<PackageReference Include="Microsoft.AspNetCore.App" Version="3.0.*"/>
99
</ItemGroup>
1010

1111
</Project>

csharp/aspnetcore/config.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
framework:
22
website: docs.microsoft.com/en-us/aspnet/index
3-
version: 2.2
4-
3+
version: 3.0

0 commit comments

Comments
 (0)