While building docker images getting below error - docker

WARNING: buildx: failed to get git commit: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'
tried to build image but getting above error
because there is no relationship with git why I'm getting git related issues becuase I am creating docker image from Dockerfile

Related

The RWPickFlavor.podspec specification does not validate

I'm learning by following this tutorial:
https://www.raywenderlich.com/5823-how-to-create-a-cocoapod-in-swift
And I'm stuck in the place where it says:
Using Your New CocoaPod
in the terminal I wrote:
cd ~/Documents/Libraries/RWPickFlavor
pod repo add RWPodSpecs https://github.com/user/RWPodSpecs.git
pod repo push RWPodSpecs RWPickFlavor.podspec
but I get a lot of errors:
[!] /usr/bin/git clone https://github.com/user/RWPodSpecs.git -- RWPodSpecs
fatal: destination path 'RWPodSpecs' already exists and is not an empty directory
and:
Validating spec
-> RWPickFlavor (0.1.0)
- NOTE | url: The URL (https://github.com/user/RWPickFlavor) is not reachable.
- ERROR | [iOS] unknown: Encountered an unknown error ([!] /usr/bin/git clone https://github.com/user/RWPickFlavor.git /var/folders/bw/h527d_4x6yb7rv3tdrldty1c0000gn/T/d20220525-6530-de485a --template= --single-branch --depth 1 --branch 0.1.0
Cloning into '/var/folders/bw/h527d_4x6yb7rv3tdrldty1c0000gn/T/d20220525-6530-de485a'...
warning: Could not find remote branch 0.1.0 to clone.
fatal: Remote branch 0.1.0 not found in upstream origin
) during validation.
[!] The `RWPickFlavor.podspec` specification does not validate.
Any ideas?
I had this very issue and here is how I resolved it:
Verify you are in the ~/Documents/Libraries/RWPickFlavor directory before performing any commands in Terminal.
Verify that the contents of RWPickFlavor.podspec are correct. Mine was not and, if something is wrong, then it will not validate the Podspec.
I went ahead and deleted the remote repository on GitHub and then ran rm -rf .git (again, make sure you are in ~/Documents/Libraries/RWPickFlavor). This step might be excessive, but I figured I had missed something when pushing to GitHub and, since this was just an initial commit, I did not feel like it really harmed anything. Yes, I am aware this is not best practice with regards to version control.
I then went ahead and recreated the remote repository on GitHub.
With the remote repository once again available, I did the following:
git init
git add .
git commit -m "Initial commit"
git tag 0.1.0
git branch -M main
git remote add origin https://github.com/user/RWPickFlavor.git
git push -u origin main --tags
pod repo push RWPodSpecs RWPickFlavor.podspec
Explanation: I think I/we might have forgotten the tag creation in the process and also forgot to include it in the push. Before I deleted the remote repo, I noticed that there was no tag and, even if I added a tag, the Podspec still would not validate.
Hope this is helpful.

about pod installation error in ios project

when i am trying to install the pod its showing errors. how to solve this?
Apples-MacBook-Pro:~ apple$ cd /Users/apple/Desktop/lkmmlkmk
Apples-MacBook-Pro:lkmmlkmk apple$ pod init [!] Existing Podfile found
in directory Apples-MacBook-Pro:lkmmlkmk apple$ pod install Setting up
CocoaPods master repo fatal: ambiguous argument 'HEAD': unknown
revision or path not in the working tree. Use '--' to separate paths
from revisions, like this: 'git [...] --
[...]' fatal: ambiguous argument 'HEAD': unknown revision or
path not in the working tree. Use '--' to separate paths from
revisions, like this: 'git [...] -- [...]'
fatal: ambiguous argument 'HEAD': unknown revision or path not in the
working tree. Use '--' to separate paths from revisions, like this:
'git [...] -- [...]' $ /usr/bin/git -C
/Users/apple/.cocoapods/repos/master fetch origin --progress fatal:
'origin' does not appear to be a git repository fatal: Could not
read from remote repository.
Please make sure you have the correct access rights and the
repository exists. [!] Unable to add a source with url
https://github.com/CocoaPods/Specs.git named master-1. You can try
adding it manually in ~/.cocoapods/repos or via pod repo add.
This problem got solve by re setting the git manually if anyone having same issue just reset the cocoa-pods it will help you.
Go to ~/.cocoapods/repos and run git clone https://github.com/CocoaPods/Specs.git master
it will help you to resolve the solution

git "expected shallow list" error when shallow had tested as true

I have a repo that, when tested on Travis, consistently gives an error like:
$ if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
fatal: git fetch-pack: expected shallow list
The command "if [[ -a .git/shallow ]]; then git fetch --unshallow; fi" failed and exited with 128 during .
Your build has been stopped.
You can see an example here, although it's possible that link requires authorization.
What I find strange about this that it seems the git fetch --unshallow should run only if it's already determined that it is shallow. I should add that I've used this construct in many other repositories and never had a problem.
On my local machine, the contents of .git are:
myrepo.git$ ls -a
. branches config FETCH_HEAD HEAD index logs ORIG_HEAD
.. COMMIT_EDITMSG description gitk.cache hooks info objects refs
I am not hip to the internals of Git, nor do I really understand what git fetch --unshallow is actually supposed to do, but one possibility: check which version of git you have available to your Travis test runners.
I see the same fatal: git fetch-pack: expected shallow list error message with a GitLab CI/CD shell runner on CentOS 7 VMs. CentOS 7 only has Git 1.8.something in the official repos.
This blog post is where I initially became aware of this error message being related to an old version of Git. That post suggests upgrading the OS-default version of git with third-party repos, which I didn't want to do.
What I ended up doing instead, as advised here, was setting:
variables:
GIT_STRATEGY: clone
in the .gitlab-ci.yml. This is, of course, a GitLab-specific thing, but I'm pretty positive Travis gives you some option for setting environment variables for your test environment.
See also:
gitlab runner doesn`t work on a specific project (Ryan Daniels' answer)

Can a docker build use the url of a git branch?

According to the docs, a git url can be passed to a build command:
But what happens if the git url needs to be a branch name? In other words, how do I do the equivalent of this:
git clone -b my-firefox-branch
git#github.com:creack/docker-firefox.git
Start your URL with git:// (or https://) and simply append the branch name after #.
I just forked the OP's repo and created a branch to confirm it works (docker version 1.11.1):
root#box:~# docker build git://github.com/michielbdejong/docker-firefox#michielbdejong-patch-1
Sending build context to Docker daemon 52.22 kB
Step 1 : FROM ubuntu:12.04
12.04: Pulling from library/ubuntu
4edf76921243: Downloading
[==========> ] 9.633 MB/44.3 MB
^Croot#box:~#
See https://docs.docker.com/engine/reference/commandline/build/ for full docs.
So far, No. it can't.
Here's what I got:
$ docker build git#github.com:shawnzhu/docker-ruby.git#branch1
2014/12/04 08:19:04 Error trying to use git: exit status 128 (Cloning into '/var/folders/9q/bthxttfj2lq7jtz0b_f938gr0000gn/T/docker-build-git859493111'...
fatal: remote error:
is not a valid repository name
Email support#github.com for help
)
If you take a look at this line of docker CLI code, it only do recursive git clone against given URL of a git repo (even no --depth=1) when using docker build <git-repo-url>.
However, it could be an interesting improvement to docker (if people want it) since #<branch-name> and #<commit> are popular syntax to github URL adopted by lots of tools like npm and bower.
Well it works more or less depending on versions
For recent versions : (docker-engine 1.5.0-0~trusty and+)
docker build https://github.com/rzr/iotjs.git#master
docker build https://github.com/rzr/iotjs.git
docker build github.com/rzr/iotjs.git
For older ones: (docker.io 1.4-5ubuntu1 and -)
docker build https://github.com/rzr/iotjs.git
docker build git://github.com/rzr/iotjs.git
docker build github.com/rzr/iotjs.git
Maybe this can be handled in helper script like:
curl -sL https://rawgit.com/rzr/iotjs/master/run.sh | bash -x -

Slash in branch name in Gemfile causing error

I have this in my Gemfile (using a branch with a slash):
gem 'ice_cube', github: 'seejohnrun/ice_cube', branch: 'issues/50-from_ical'
Which produces this error:
$ bundle
Updating git://github.com/seejohnrun/ice_cube.git
fatal: ambiguous argument 'issues/50-from_ical': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Git error: command `git rev-parse issues/50-from_ical` in directory
/Users/jp/.rvm/gems/ruby-2.0.0-p0#example/cache/bundler/git/ice_cube-63812451ddbe2391df352dbcaee4a6cf04a9f746 has failed.
If this error persists you could try removing the cache directory
'/Users/jp/.rvm/gems/ruby-2.0.0-p0#example/cache/bundler/git/ice_cube-63812451ddbe2391df352dbcaee4a6cf04a9f746'
Other branches (without slashes) work. Does anyone know how to get around this? Thanks!
Are you sure the issue is the /? I checked the referenced repo and there is no public branch issues/50-from_ical.
I believe the problem is that the branch doesn't exist at all.

Resources