Why is docker pushing old code to remote server

An Nguyen

I've tried pushing the newly built image to ECR but it seemed that it always kept pushing the old code from cache to ECR. I've tried to clear out cache with the following commands and rebuilt the image but the issue remained:

  • Clear out docker
docker rmi $$(docker images | grep none | awk '{print $$3}') -f
docker system prune -a -f
  • Rebuild the image
docker build -t $(DOMAIN)/$(REPO_NAME):$(IMAGE_VERSION) -f docker/Dockerfile . --no-cache
  • pushing the image to ECR
docker push $REPO_ID.dkr.ecr.$REGION.amazonaws.com/$(DOMAIN)/$(REPO_NAME):$(IMAGE_VERSION)

I've tested the built image locally and it works with the new code. However, when I run the image remotely, it ran the old code and failed

I have no idea what was going on. Can someone help me on this please?

An Nguyen

I have sorted this out. I would need to update the function image by the following:

aws lambda update-function-code --function-name my-lambda-func --image-uri $REPO_ID.dkr.ecr.$REGION.amazonaws.com/$(DOMAIN)/$(REPO_NAME):latest

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

cannot see my code on the remote server after pushing it

VS Code Git push is not pushing the code to remote

I am still pushing my code with an old email?

Pushing local workspace code to TFS server

Retain long Docker tags in local registry after pushing to remote?

Setting up an old Mac as a remote selenium server

Unable to delete payload after pushing it to remote server using ExpressionEvaluatingRequestHandlerAdvice

Pushing mocks to remote wiremock server fails with "JSON Parsing" Error

Xdebug Remote Debugging inside Docker on remote server

Why do I get error: RPC failed; result=52, HTTP code = 0 fatal: The remote end hung up unexpectedly when pushing to github?

Git pushing to remote branch

Pushing to a remote with basic authentication

GitKraken not pushing files to remote

Github Action triggered on push tag, does trigger after deleting tag and pushing again but will use old version of code

Pushing value to stack in Assembly: why code is using particular order

Git initialize old project from local pc to remote server

Reactive Banana 1.0.0 - Why is this old code breaking?

Download docker logs from remote server

how to connect remote docker container mysql server

How to run docker load in remote server

How to make docker reset the image on remote server?

How to use a remote docker server from jenkins?

docker phpmyadmin - how to add remote server

Python Docker Remote Debugging VS Code

Remote debugging NodeJS in Docker with Visual Studio Code

Docker Remote API exec: Command exit code

Why does my remote Git repository have uncommitted changes after pushing to it?

Pushing git commit from remote server through SSH: Permission denied (publickey). fatal: Could not read from remote repository

Pushing images to docker hub