Skip to content

Commit 39d92d4

Browse files
authored
CI: move ./docker to ./build/docker (#4130)
1 parent 17a743b commit 39d92d4

40 files changed

+18
-18
lines changed

.github/workflows/docker-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
4343
with:
4444
context: .
45-
file: ./Dockerfile${{ matrix.flavor == 'debian' && '.debian' || '' }}
45+
file: ./build/docker/Dockerfile${{ matrix.flavor == 'debian' && '.debian' || '' }}
4646
tags: crowdsecurity/crowdsec:test${{ matrix.flavor == 'full' && '' || '-' }}${{ matrix.flavor == 'full' && '' || matrix.flavor }}
4747
target: ${{ matrix.flavor == 'debian' && 'full' || matrix.flavor }}
4848
platforms: linux/amd64
@@ -58,17 +58,17 @@ jobs:
5858
with:
5959
version: 0.5.24
6060
enable-cache: true
61-
working-directory: "./docker/test"
61+
working-directory: "./build/docker/test"
6262

6363
- name: "Set up Python"
6464
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
6565
with:
66-
python-version-file: "./docker/test/.python-version"
66+
python-version-file: "./build/docker/test/.python-version"
6767

6868
# running serially to reduce test flakiness
6969
- name: Lint and run the tests
7070
run: |
71-
cd docker/test
71+
cd build/docker/test
7272
uv sync --all-extras --dev --locked
7373
uv run ruff check
7474
uv run basedpyright

.github/workflows/publish-docker-master.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ on:
77
- 'pkg/**'
88
- 'cmd/**'
99
- 'build/mk/**'
10-
- 'docker/docker_start.sh'
11-
- 'docker/config.yaml'
10+
- 'build/docker/Dockerfile'
11+
- 'build/docker/Dockerfile.debian'
12+
- 'build/docker/docker_start.sh'
13+
- 'build/docker/config.yaml'
1214
- '.github/workflows/publish-docker-master.yml'
1315
- '.github/workflows/publish-docker.yml'
14-
- 'Dockerfile'
15-
- 'Dockerfile.debian'
1616
- 'go.mod'
1717
- 'go.sum'
1818
- 'Makefile'

.github/workflows/publish-docker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
9696
with:
9797
context: .
98-
file: ./Dockerfile${{ inputs.debian && '.debian' || '' }}
98+
file: ./build/docker/Dockerfile${{ inputs.debian && '.debian' || '' }}
9999
push: ${{ inputs.push }}
100100
tags: ${{ steps.slim.outputs.tags }}
101101
target: slim
@@ -111,7 +111,7 @@ jobs:
111111
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
112112
with:
113113
context: .
114-
file: ./Dockerfile${{ inputs.debian && '.debian' || '' }}
114+
file: ./build/docker/Dockerfile${{ inputs.debian && '.debian' || '' }}
115115
push: ${{ inputs.push }}
116116
tags: ${{ steps.full.outputs.tags }}
117117
target: full

.github/workflows/update_docker_hub_doc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- master
77
paths:
8-
- 'docker/README.md'
8+
- 'build/docker/README.md'
99

1010
jobs:
1111
update-docker-hub-readme:
@@ -26,4 +26,4 @@ jobs:
2626
password: ${{ secrets.DOCKER_PASSWORD }}
2727
repository: crowdsecurity/crowdsec
2828
short-description: "Crowdsec - An open-source, lightweight agent to detect and respond to bad behaviours."
29-
readme-filepath: "./docker/README.md"
29+
readme-filepath: "./build/docker/README.md"

Dockerfile renamed to build/docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/co
4444

4545
COPY --from=build /go/bin/yq /usr/local/bin/crowdsec /usr/local/bin/cscli /usr/local/bin/
4646
COPY --from=build /etc/crowdsec /staging/etc/crowdsec
47-
COPY --from=build /go/src/crowdsec/docker/docker_start.sh /
48-
COPY --from=build /go/src/crowdsec/docker/config.yaml /staging/etc/crowdsec/config.yaml
47+
COPY --from=build /go/src/crowdsec/build/docker/docker_start.sh /
48+
COPY --from=build /go/src/crowdsec/build/docker/config.yaml /staging/etc/crowdsec/config.yaml
4949
COPY --from=build /var/lib/crowdsec /staging/var/lib/crowdsec
5050
RUN yq -n '.url="http://0.0.0.0:8080"' | install -m 0600 /dev/stdin /staging/etc/crowdsec/local_api_credentials.yaml
5151

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ RUN apt-get update && \
6161

6262
COPY --from=build /go/bin/yq /usr/local/bin/crowdsec /usr/local/bin/cscli /usr/local/bin/
6363
COPY --from=build /etc/crowdsec /staging/etc/crowdsec
64-
COPY --from=build /go/src/crowdsec/docker/docker_start.sh /
65-
COPY --from=build /go/src/crowdsec/docker/config.yaml /staging/etc/crowdsec/config.yaml
64+
COPY --from=build /go/src/crowdsec/build/docker/docker_start.sh /
65+
COPY --from=build /go/src/crowdsec/build/docker/config.yaml /staging/etc/crowdsec/config.yaml
6666
RUN yq -n '.url="http://0.0.0.0:8080"' | install -m 0600 /dev/stdin /staging/etc/crowdsec/local_api_credentials.yaml && \
6767
yq eval -i ".plugin_config.group = \"nogroup\"" /staging/etc/crowdsec/config.yaml
6868

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ You can build your custom images with Dockerfile and Dockerfile-debian.
4848
For example, if you need a Debian version without plugin notifiers:
4949

5050
```console
51-
$ docker build -f Dockerfile.debian --target slim .
51+
$ docker build -f build/docker/Dockerfile.debian --target slim .
5252
```
5353

5454
The supported values for target are: full, geoip, plugins, slim.
5555

5656
Note: for crowdsec versions < 1.5.0, the syntax is
5757

5858
```console
59-
$ docker build -f Dockerfile.debian --build-arg=BUILD_ENV=slim .
59+
$ docker build -f build/docker/Dockerfile.debian --build-arg=BUILD_ENV=slim .
6060
```
6161

6262

0 commit comments

Comments
 (0)