I am new to docker and would like to containerize a specific git branch of my app.If I run docker build and give the location of my dockerfile, an image will be build but from the local master branch by default.I want to be able to build another branch say "develop".I have done some research and all the answers I found suggest building from a specific remote branch and not a specific local branch.
Docker build specific local git branch
4.7k Views Asked by Zadiki Hassan Ochola At
1
There are 1 best solutions below
Related Questions in GIT
- problem to push files on a repository git
- diff3 output in git conflict style, including mergeable hunks
- Git Not In Sync with Local Branch
- Setting up the version control of .dotfiles while the .config is connected to a forked repo
- How to fix overriding the main branch in Git?
- I can't add text to "Message" in VS Code when committing to Git
- How can i redirect pull request from main branch to another branch
- Xcode commits (possibly outside of any branch) disappeared, how to get them back?
- Git/TortoiseGit : how to apply ONLY the changes from ONE commit from branch A, to branch B?
- How can I reintroduce username an password on git using fedora?
- GIT SKIP EMPTY DIRECTORIES
- Git smudge run once per checkout or per commit?
- I can't find ~/.profile or ~/.bashrc in C:/Users/<user>/.ssh folder
- Set environment variable during push for GitHub Actions
- Android WebRTC compile
Related Questions in DOCKER
- sqlplus myusername/mypassword@ORCL not working with Oracle on Docker
- Golang == Error: OCI runtime create failed: unable to start container process: exec: "./bin": stat ./bin: no such file or directory: unknown
- Only the first SQL script gets executed inside Docker Postgres container
- Retrieve the Dockerfile configuration from the Kubernetes and also change container Java parameter?
- Polars with Rust: Out of Memory Error when Processing Large Dataset in Docker Using Streaming
- Compiling eBPF program in Docker fails due to missing '__u64' type
- AttributeError: module 'numba' has no attribute 'generated_jit'
- Phoenix in a docker dev environment - generated code can't be saved from VSCode
- Docker on Multipass VMs: Connecting worker nodes to swarm results in rcp error
- Facing error in creating image of my react+vite project . Dockerfile error
- NextJS Docker build fails: fetch failed ECONNREFUSED
- Docker container unable to make HTTPS requests to external API
- Failed to connect to your instance after deploying mern app on aws ec2 instance when i try to access frontend
- Connecting to Postgres running in a Docker container using psql
- Can't connect to local postgresql server from my docker container
Related Questions in DOCKER-COMPOSE
- Only the first SQL script gets executed inside Docker Postgres container
- Phoenix in a docker dev environment - generated code can't be saved from VSCode
- NextJS Docker build fails: fetch failed ECONNREFUSED
- Failed to connect to your instance after deploying mern app on aws ec2 instance when i try to access frontend
- Passing arguments to ENTRYPOINT causes the container to start and run indefinitely
- Why docker-compose volume binding didn't work during the build? Should I always COPY necessary for build files?
- docker-compose can't reset postgresql database
- mySQL through docker compose not available at localhost
- Problem running wagtail(CMS for django) and postgresql in Docker Compose
- Docker: keep python packages consistent
- How to create a docker composer environment where containers can communicate each other?
- Error: P1001: Can't reach database server at `db`:`5432` on github actions
- Springboot Kafka Consumer unable to maintain connect to kafka cluster brokers
- Nodejs application cannot communicate with postgresql (docker-compose)
- Issues with redirect when setting up Traefik Reverse Proxy in Docker
Related Questions in DOCKER-MACHINE
- sudo docker container prune recovery
- Docker service startup failed with status 203
- How to run docker build command inside a docker container?
- Is named docker Volume stored on host machine
- Jenkins configuration file in jenkins docker container
- Dockerfile - nuxt: Permission denied
- How to start two Docker containers nginx locally
- Docker Swarm initialization in AWS :Error creating machine: Error running provisioning: error installing docker:
- ERROR: Preparation failed: exec: "docker-machine": executable file not found in $PATH
- A solution for using docker and wsl in windows 10
- Docker on windows wsl not running daemon
- Jetty 12 docker war not booting
- How can I enhance the speed of docker site
- How to fix Docker connection reset by peer, Docker Status is UP but cannot connect to sever?
- About "Cannot connect to the Docker daemon at unix:///var/run/docker.sock" ERROR
Related Questions in BOOT2DOCKER
- Unable to download or very slow download of boot2docker.iso (v19.03.5) from github repo
- Some question on Boot2docker setup for build and run
- Unable to use Shared folder from Windows 10 to boot2docker VM after boot2docker v18.06
- Docker compose considers the build context as a relative path instead of a URL
- Docker build specific local git branch
- boot2docker / bootsync.sh ignores my default gateway?
- How to distinguish between Docker Toolbox and Docker for Mac/Windows?
- Docker - IP address of container on Windows
- docker-machine can't create more than two VMs
- Zookeeper docker container stuck
- Unable to run Docker Toolbox on windows 10 home even after enabling virtualization from BIOS settings
- How can I make Docker container shared files with host appeared in the container?
- Configuring corp proxy for Docker on Oracle VM VirtualBox
- How migrate physical postgres database data to postgres container
- Docker for Windows - Mount directory is coming empty
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You’d do this the same way you’d build or run any other program, from source, from a non-default branch: check out the branch you want to run locally, then run
docker build.(I need to do this fairly routinely in my day job: it lets me check out my colleague’s proposed feature branches and actually run them myself. Doing things like this, or trying to build a Docker image of yesterday’s code and not the thing that broke today, tends to be a pretty good reason to not
git clonefrom within your Dockerfile.)