Skip to content

Commit

Permalink
fix building fresh docker images for integration tests
Browse files Browse the repository at this point in the history
i always get bitten by some caching or missing checks when i use docker...
Dockerfile.moxmail doesn't exist anymore, but that doesn't matter, it doesn't
even look at it but will just use some image that is still around (based on the
name?) i suppose that means docker-compose also doesn't rebuild an image when
the dockerfile mentioned in the build changes.
  • Loading branch information
mjl- committed Jul 26, 2023
1 parent 5be4e91 commit 6273afe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ fuzz:


test-integration:
docker image build --pull -f Dockerfile -t mox_integration_moxmail .
docker image build --pull -f testdata/integration/Dockerfile.test -t mox_integration_test testdata/integration
docker image build --pull --no-cache -f Dockerfile -t mox_integration_moxmail .
docker image build --pull --no-cache -f testdata/integration/Dockerfile.test -t mox_integration_test testdata/integration
-rm -rf testdata/integration/moxacmepebble/data
-rm -rf testdata/integration/moxmail2/data
-rm -f testdata/integration/tmp-pebble-ca.pem
Expand Down
8 changes: 3 additions & 5 deletions docker-compose-integration.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: '3.7'
services:
# We run integration_test.go from this container, it connects to both mox instances.
# We run integration_test.go from this container, it connects to the other mox instances.
test:
hostname: test.mox1.example
image: mox_integration_test
Expand Down Expand Up @@ -86,10 +86,8 @@ services:
localserve:
hostname: localserve.mox1.example
domainname: mox1.example
build:
dockerfile: Dockerfile.moxmail
context: testdata/integration
command: ["sh", "-c", "set -e; chmod o+r /etc/resolv.conf; go run . -- localserve -ip 172.28.1.60"]
image: mox_integration_moxmail
command: ["sh", "-c", "set -e; chmod o+r /etc/resolv.conf; mox localserve -ip 172.28.1.60"]
volumes:
- ./.go:/.go
- ./testdata/integration/resolv.conf:/etc/resolv.conf
Expand Down

0 comments on commit 6273afe

Please sign in to comment.