web analytics

Monthly Archives January 2021

Docker re-tag images

Often there are tags with images when they are pulled. If you want to rename that tag, all you need to do is the following steps.

  1. Pull the image
  2. Re-tag the image using docker tag imagename:current_tag imagename:new_tag
  3. docker rmi image:current_tag

When you re-tag, it will leave you with two different images with different tags and we need to get rid of the old one using step3.

An example given below

  1. Pull the image
    [abc@host ~]$ sudo docker pull busybox:old
    musl: Pulling from library/busybox
    2bafa357a9a5: Pull complete
    Digest: sha256:658f4fcf74879ed5a01bf310d018099413f3b2588c1565ac54c85253ba3fc6d4
    Status: Downloaded newer image for busybox:old
  2. Verify the image
    [abc@host ~]$ sudo docker images
    busybox ...
Read More

Git conflicts – How to resolve conflicts and merge

Sometimes when you merge two git branches, it might give you conflict. Conflict occurs because the same line in the same file has been edited differently in the two branches. This confuses git as to which change to accept and merge. Git conflicts are to be always resolved manually before git can proceed with the merge.

For example, I have two different branches here named current-branch and dev-branch. I want to merge the changes in dev-branch to current-branch now but I am getting a conflict.

[root@abc]# git branch
* current-branch

[root@abc]# git merge new-branch
Auto-merging abc.txt
CONFLICT (content): Merge conflict in abc.txt
Automatic merge failed; fix conflicts and then commit the result.

Now, to resolve the conflict, you the git mergetool

If you have not already conf...

Read More

Multiple SSH identities in Git

After a long break of nearly 2 years, I tried to brush up my knowledge and wanted to started with Git. I created a bitbucket repo under my personal account, and setup the identities but no matter what, I was unable to clone the repo via ssh. I was getting the following error while trying to do it.

git clone -b master git@bitbucket.org:myusername/magento2.3.git
Cloning into ‘magento2.3’…
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

The error clearly stated it was a problem with my ssh key. I already checked and confirmed the following

  1. I have added the SSH public key to the repo’s Access keys option.
  2. I also tried to add it under Personal Settings -> Security -> SSH keys but both ...

Read More