# Docker deploy run old code

**URL:** <https://forums.docker.com/t/docker-deploy-run-old-code/147568>\
**Category:** Image Builds\
**Tags:** docker, windows\
**Created:** [April 10, 2025, 1:24am UTC](https://forums.docker.com/t/docker-deploy-run-old-code/147568 "2025-04-10T01:24:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![george2006878](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/george2006878/32/55308_2.png) [@george2006878](https://forums.docker.com/u/george2006878)\
**Post date:** [April 10, 2025, 1:24am UTC](https://forums.docker.com/t/docker-deploy-run-old-code/147568/1 "2025-04-10T01:24:32Z")

</div>

Help: I downloaded the NocoDB source code from github and modified some of the project’s code (frontend and backend). It runs fine locally. After deploying it to docker using the command, I found that the code in the container is new, but the website is still running the old code. Does anyone know why this is happening?The following is a screenshot of my container and a screenshot of the website running. It doesn’t seem to be a cache issue. I have restarted the computer many times and cleared the browser cache.

 ![image](https://global.discourse-cdn.com/docker/original/3X/1/c/1c1acd5e66b539719ffde98a44205c7ead7b3812.png)

I used the command ./build-local-docker-image.sh (See the code below) to build the image, and then deployed it through  
`docker run -d --name nocodb-mysql-v2 -v "$(pwd)"/nocodb:/usr/app/data/ -p 8080:8080 -e NC_DB="mysql2://host.docker.internal:3306?u=root&p=123456&d=d1" -e NC_AUTH_JWT_SECRET="569a1821-0a93-45e8-87ab-eb857f20a010" nocodb-local`

```auto
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
LOG_FILE=${SCRIPT_DIR}/build-local-docker-image.log
ERROR=""

function stop_and_remove_container() {
    # Stop and remove the existing container
    docker stop nocodb-local >/dev/null 2>&1
    docker rm nocodb-local >/dev/null 2>&1
}

function remove_image() {
    # Remove the existing image
    docker rmi nocodb-local >/dev/null 2>&1
}

function install_dependencies() {
    # Install all dependencies
    cd ${SCRIPT_DIR}
    pnpm bootstrap || ERROR="install_dependencies failed"
}

function build_gui() {
    # build nc-gui
    export NODE_OPTIONS="--max_old_space_size=16384"
    # generate static build of nc-gui
    cd ${SCRIPT_DIR}/packages/nc-gui
    pnpm run generate || ERROR="gui build failed"
}

function copy_gui_artifacts() {
     # copy nc-gui build to nocodb dir
    rsync -rvzh --delete ./dist/ ${SCRIPT_DIR}/packages/nocodb/docker/nc-gui/ || ERROR="copy_gui_artifacts failed"
}

function package_nocodb() {
    # build nocodb ( pack nocodb-sdk and nc-gui )
    cd ${SCRIPT_DIR}/packages/nocodb
    pnpm run docker:build || ERROR="package_nocodb failed"
}

function build_image() {
    # build docker
    docker build . -f Dockerfile.local -t nocodb-local || ERROR="build_image failed"
}

function log_message() {
    if [[${ERROR} != ""]];
    then
        >&2 echo "build failed, Please check build-local-docker-image.log for more details"
        >&2 echo "ERROR: ${ERROR}"
        exit 1
    else
        echo 'docker image with tag "nocodb-local" built sussessfully. Use below sample command to run the container'
        echo 'docker run -d -p 3333:8080 --name nocodb-local nocodb-local '
    fi
}

echo "Info: Stopping and removing existing container and image" | tee ${LOG_FILE}
stop_and_remove_container
remove_image

echo "Info: Installing dependencies" | tee -a ${LOG_FILE}
install_dependencies 1>> ${LOG_FILE} 2>> ${LOG_FILE}

echo "Info: Building nc-gui" | tee -a ${LOG_FILE}
build_gui 1>> ${LOG_FILE} 2>> ${LOG_FILE}

echo "Info: Copy nc-gui build to nocodb dir" | tee -a ${LOG_FILE}
copy_gui_artifacts 1>> ${LOG_FILE} 2>> ${LOG_FILE}

echo "Info: Build nocodb, package nocodb-sdk and nc-gui" | tee -a ${LOG_FILE}
package_nocodb 1>> ${LOG_FILE} 2>> ${LOG_FILE}

if [[${ERROR} == ""]]; then
    echo "Info: Building docker image" | tee -a ${LOG_FILE}
    build_image 1>> ${LOG_FILE} 2>> ${LOG_FILE}
fi

log_message | tee -a ${LOG_FILE}

```

---

<div class="post-metadata">

**Author:** ![george2006878](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/george2006878/32/55308_2.png) [@george2006878](https://forums.docker.com/u/george2006878)\
**Post date:** [April 10, 2025, 1:26am UTC](https://forums.docker.com/t/docker-deploy-run-old-code/147568/2 "2025-04-10T01:26:03Z")

</div>

![image](https://global.discourse-cdn.com/docker/original/3X/9/d/9dfdef4cff40d421a0c0ea3d0792fd951461f7c7.png)

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/bluepuma77/32/32688_2.png) [@bluepuma77](https://forums.docker.com/u/bluepuma77)\
**Post date:** [April 10, 2025, 4:34pm UTC](https://forums.docker.com/t/docker-deploy-run-old-code/147568/3 "2025-04-10T16:34:20Z")

</div>

Use 3 backticks before and after code/config to make it more readable and preserve spacing.

---

<div class="post-metadata">

**Author:** ![rimelek](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rimelek/32/41602_2.png) [@rimelek](https://forums.docker.com/u/rimelek)\
**Post date:** [April 11, 2025, 11:18pm UTC](https://forums.docker.com/t/docker-deploy-run-old-code/147568/4 "2025-04-11T23:18:23Z")

</div>

You probably override the content with the bind mounted folder. If anything is updated in the image under `/usr/app/data` it will never be updated in the container since you mount already existing data from the host.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/docker/original/3X/d/4/d4fbccd46c81bfcffe9822e20e17736d946fa821.png) [@system](https://forums.docker.com/u/system)\
**Post date:** [May 11, 2025, 11:19pm UTC](https://forums.docker.com/t/docker-deploy-run-old-code/147568/5 "2025-05-11T23:19:15Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
