Questions tagged git

Explore the latest questions and answers asked by our top developers.

How to initialize a Git Submodule in Dockerfile

In my recent project I’ve come to use Git Submodules, however I’m struggling to get my Docker container to download the information from the submodule on deployment. Here’s my Dockerfile (disclaimer: I am using CapRover, so their Dockerfile is formatted different, but everything is the same): "FROM library/node:16.6.0-alpine", "RUN apk update && apk upgrade && […]

By FxllenCode
Published
Categorised as caprover, docker, git, git-submodules, javascript Tagged , , , ,

Skipping cloning again between steps bitbucket pipelines

I have a setup where a monorepo runs some parallel steps and each step currently does a clone. Each steps adds up extra 1 min cloning time to build time as its repetitive and unencessary. As you can see the build setup takes around 1 minutes to clone the repo. Is there a way we […]

By Leap Hawk
Published
Categorised as bitbucket, bitbucket-pipelines, docker, git Tagged , , ,

How to push two different images with different tags to a single GitHub repository?

Let’s say I have built two docker images on my local machine. One for .NET and one for React. Since they are different images, of course they can’t both have the same tag. Let’ say I have tagged them: ghcr.io/project/api ghcr.io/project/front And let’s say my repository address is github.com/username/repo. And I have also logged into […]

By Hossein Fallah
Published
Categorised as docker, ghcr, git, github Tagged , , ,

Docker Build a GitHub Repository and Push to DockerHub

I’ve got a GitHub repo which has a Dockerfile in the project root. I want to build the repository, but am experiencing errors. Command run (The Dockerfile is located in the repository root, in the main branch) $ docker build https://github.com/$RepoOwner/$RepositoryName.git#main:. $ docker build https://github.com/$RepoOwner/$RepositoryName.git#main: Both yield the following error: unable to prepare context: unable […]

By M Choy
Published
Categorised as build, docker, git, github, linux Tagged , , , ,

How to properly clone a repository from github when mounting a docker image?

Briefly about what I’m trying to do: push frontend, backend and other services into separate repositories and clone the source code from git during image mounting instead of using the usual COPY . ./app. Here is my Dockerfile with the problem area: # Install git. RUN apk update && apk add git # Install composer. […]

By pisari2750
Published
Categorised as docker, docker-compose, dockerfile, git, laravel Tagged , , , ,

How to do interactive rebase in a docker container in Visual Studio Code?

I would like to ask how to correctly solve this problem. I have Visual Studio Code set up with docker containers so I can edit, build and even debug my project that is in a git. I am using NodeJS/Typescript docker image mcr.microsoft.com/vscode/devcontainers/typescript-node. The problem is when I try to do interactive rebase in git […]

By Ji Lechner
Published
Categorised as docker, git, visual-studio-code Tagged , ,

/bin/sh: git: not found – GitLab CI with Nx Workspaces

I have used nx workspaces for my monorepo which relies on the nx-affected utility to know the difference between two states. I want to trigger a staging deployment when code is pushed to that branch hence I am using the command below yarn nx affected:build –base=origin/$CI_COMMIT_BRANCH~1 –head=$CI_COMMIT_BRANCH –prod running this locally works just fine but […]

By malik bagwala
Published
Categorised as containers, docker, git, gitlab-ci, nx-workspace Tagged , , , ,

Dockerfile RUN and setting ENV

EDIT I want to pass the last git short hash into my React app build with the following command: git log -1 –pretty=%h Thus in my Dockerfile I want something such as: ARG REACT_APP_GIT_SHORTHASH RUN git clone https://[email protected]/paulywill/repo.git && cd repo && $REACT_APP_GIT_SHORTHASH=`git log -1 –pretty=%h` ENV REACT_APP_GIT_SHORTHASH $REACT_APP_GIT_SHORTHASH In my Github Actions build I’m […]

By paulywill
Published
Categorised as docker, git, github, reactjs Tagged , , ,

Dockerfile – RUN and setting ENV – intermediate container

EDIT I want to pass the last git short hash into my React app build with the following command: git log -1 –pretty=%h Thus in my Dockerfile I want something such as: ARG REACT_APP_GIT_SHORTHASH RUN git clone https://[email protected]/paulywill/repo.git && cd repo && export REACT_APP_GIT_SHORTHASH=`git log -1 –pretty=%h` ENV REACT_APP_GIT_SHORTHASH $REACT_APP_GIT_SHORTHASH In my Github Actions build […]

By paulywill
Published
Categorised as docker, git, github, reactjs Tagged , , ,

ERROR: Service ‘bootstrap’ failed to build : Build failed

I’m getting this error whenever I run: "docker-compose up -d: I’m using windows 10, could someone help me? please! => ERROR [2/6] RUN apk add –update git bash nodejs nodejs-npm perl 1.6s —— > [2/6] RUN apk add –update git bash nodejs nodejs-npm perl: #5 0.412 fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz #5 0.945 fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz #5 1.467 ERROR: […]

By Jayron
Published
Categorised as bash, docker, git, node.js, perl Tagged , , , ,
1 2 3 41

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq