Skip to content

Commit c341073

Browse files
Copilotshaypal5
andauthored
Pin MongoDB Docker image to mongo:8 instead of mongo:latest (#370)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: shaypal5 <917954+shaypal5@users.noreply.github.com>
1 parent 2986978 commit c341073

6 files changed

Lines changed: 8 additions & 8 deletions

File tree

.github/workflows/ci-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,12 @@ jobs:
135135
# uses: borda/cache-container-images-action@b32a5e804cb39af3c3d134fc03ab76eac0bfcfa9
136136
# with:
137137
# prefix-key: "mongo-db"
138-
# images: mongo:latest
138+
# images: mongo:8
139139
- name: Start MongoDB in docker
140140
if: matrix.backend == 'mongodb'
141141
run: |
142142
# start MongoDB in a container
143-
docker run -d -p ${{ env.CACHIER_TEST_PORT }}:27017 --name mongodb mongo:latest
143+
docker run -d -p ${{ env.CACHIER_TEST_PORT }}:27017 --name mongodb mongo:8
144144
# wait for MongoDB to start, which is in average 5 seconds
145145
sleep 5
146146
# show running containers

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ mongo-start:
115115
@echo "Starting MongoDB container..."
116116
@docker ps -q -f name=cachier-test-mongo | grep -q . && \
117117
(echo "MongoDB container already running" && exit 0) || \
118-
(docker run -d -p 27017:27017 --name cachier-test-mongo mongo:latest && \
118+
(docker run -d -p 27017:27017 --name cachier-test-mongo mongo:8 && \
119119
echo "Waiting for MongoDB to start..." && sleep 5)
120120

121121
mongo-stop:

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ This script automatically handles Docker container lifecycle, environment variab
746746
.. code-block:: bash
747747
748748
# Start MongoDB with Docker
749-
docker run -d -p 27017:27017 --name cachier-test-mongo mongo:latest
749+
docker run -d -p 27017:27017 --name cachier-test-mongo mongo:8
750750
751751
# Run tests
752752
CACHIER_TEST_HOST=localhost CACHIER_TEST_PORT=27017 CACHIER_TEST_VS_DOCKERIZED_MONGO=true pytest -m mongo

scripts/README-local-testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ The script manages the following containers:
123123

124124
| Backend | Container Name | Port | Image |
125125
| ---------- | --------------------- | ----- | -------------- |
126-
| MongoDB | cachier-test-mongo | 27017 | mongo:latest |
126+
| MongoDB | cachier-test-mongo | 27017 | mongo:8 |
127127
| Redis | cachier-test-redis | 6379 | redis:7-alpine |
128128
| PostgreSQL | cachier-test-postgres | 5432 | postgres:15 |
129129

scripts/docker-compose.all-cores.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version: "3.8"
55

66
services:
77
mongodb:
8-
image: mongo:latest
8+
image: mongo:8
99
container_name: cachier-test-mongo
1010
ports:
1111
- "27017:27017"

scripts/test-local.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,9 @@ start_mongodb() {
321321

322322
# Start MongoDB
323323
if [ "$VERBOSE" = true ]; then
324-
docker run -d -p 27017:27017 --name $MONGO_CONTAINER mongo:latest
324+
docker run -d -p 27017:27017 --name $MONGO_CONTAINER mongo:8
325325
else
326-
docker run -d -p 27017:27017 --name $MONGO_CONTAINER mongo:latest > /dev/null 2>&1
326+
docker run -d -p 27017:27017 --name $MONGO_CONTAINER mongo:8 > /dev/null 2>&1
327327
fi
328328

329329
# Wait for MongoDB to be ready

0 commit comments

Comments
 (0)