Skip to content

Commit 5726acf

Browse files
committed
chore: use one dockerfile for all tools
1 parent 39c6baf commit 5726acf

File tree

18 files changed

+41
-149
lines changed

18 files changed

+41
-149
lines changed

docker-bake.hcl

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ group "default" {
44

55
target "postgres" {
66
context = "./tools/postgres"
7-
dockerfile = "Dockerfile"
7+
dockerfile = "../tool/Dockerfile"
88
tags = ["ghcr.io/withlogicco/devcontainers/tools/postgres:latest"]
9+
args = {
10+
TOOL_NAME = "postgres"
11+
TOOL_VERSION = "17.4"
12+
}
913
contexts = {
1014
base = "target:base"
1115
builder = "target:builder"
@@ -14,8 +18,12 @@ target "postgres" {
1418

1519
target "git" {
1620
context = "./tools/git"
17-
dockerfile = "Dockerfile"
21+
dockerfile = "../tool/Dockerfile"
1822
tags = ["ghcr.io/withlogicco/devcontainers/tools/git:latest"]
23+
args = {
24+
TOOL_NAME = "git"
25+
TOOL_VERSION = "2.51.0"
26+
}
1927
contexts = {
2028
base = "target:base"
2129
builder = "target:builder"
@@ -24,8 +32,12 @@ target "git" {
2432

2533
target "node" {
2634
context = "./tools/node"
27-
dockerfile = "Dockerfile"
35+
dockerfile = "../tool/Dockerfile"
2836
tags = ["ghcr.io/withlogicco/devcontainers/tools/node:latest"]
37+
args = {
38+
TOOL_NAME = "node"
39+
TOOL_VERSION = "22.18.0"
40+
}
2941
contexts = {
3042
base = "target:base"
3143
builder = "target:builder"
@@ -34,8 +46,12 @@ target "node" {
3446

3547
target "zsh" {
3648
context = "./tools/zsh"
37-
dockerfile = "Dockerfile"
49+
dockerfile = "../tool/Dockerfile"
3850
tags = ["ghcr.io/withlogicco/devcontainers/tools/zsh:latest"]
51+
args = {
52+
TOOL_NAME = "zsh"
53+
TOOL_VERSION = "5.9"
54+
}
3955
contexts = {
4056
base = "target:base"
4157
builder = "target:builder"

tools/builder/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# syntax=docker/dockerfile:1.17.0
2-
31
FROM base
42

53
ENV DEBIAN_FRONTEND=noninteractive

tools/git/Dockerfile

Lines changed: 0 additions & 42 deletions
This file was deleted.

tools/git/builder/bin/1-download.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -eux
44

55
export $(cat $BUILDER_ENV_FILE)
66

7-
curl -fsSL -o git.tar.xz https://www.kernel.org/pub/software/scm/git/git-$GIT_VERSION.tar.xz
7+
curl -fsSL -o git.tar.xz https://www.kernel.org/pub/software/scm/git/git-$TOOL_VERSION.tar.xz
88

99
tar -xJf git.tar.xz
1010
rm git.tar.xz

tools/git/builder/bin/2-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -eux
44

55
export $(cat $BUILDER_ENV_FILE)
66

7-
cd git-$GIT_VERSION
7+
cd git-$TOOL_VERSION
88

99
make configure
1010
./configure --prefix=$TOOL_DIR --with-openssl --with-curl

tools/node/builder/bin/1-download.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ set -ex
44

55
export $(cat $BUILDER_ENV_FILE)
66

7-
curl -fsSL -o node.tar.xz https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-$NODE_ARCH.tar.xz
7+
curl -fsSL -o node.tar.xz https://nodejs.org/dist/v$TOOL_VERSION/node-v$TOOL_VERSION-$NODE_ARCH.tar.xz
88
tar -xJf node.tar.xz
99
rm node.tar.xz

tools/node/builder/bin/2-install.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -eux
44

55
export $(cat $BUILDER_ENV_FILE)
66

7-
mv node-v$NODE_VERSION-$NODE_ARCH/bin $TOOL_DIR/
8-
mv node-v$NODE_VERSION-$NODE_ARCH/include $TOOL_DIR/
9-
mv node-v$NODE_VERSION-$NODE_ARCH/lib $TOOL_DIR/
10-
mv node-v$NODE_VERSION-$NODE_ARCH/share $TOOL_DIR/
7+
mv node-v$TOOL_VERSION-$NODE_ARCH/bin $TOOL_DIR/
8+
mv node-v$TOOL_VERSION-$NODE_ARCH/include $TOOL_DIR/
9+
mv node-v$TOOL_VERSION-$NODE_ARCH/lib $TOOL_DIR/
10+
mv node-v$TOOL_VERSION-$NODE_ARCH/share $TOOL_DIR/

tools/postgres/Dockerfile

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)