Sign inSign up

trueosiris/git

By trueosiris

•Updated over 3 years ago

Image
0

888

trueosiris/git repository overview

⁠docker-git

Minimal Ubuntu 22.04 sandbox container with git functionalities, with some simplified commands.
Functionality: minimal container with vim & git to work on docker images.
Use at own risk, as the username/pass are somewhat exposed in a credentials file.

Trueosiris Rules Docker Pulls Docker Stars Docker Image Size Github stars Github forks Github issues Github last-commit

⁠setup
  • At first start of the container, a credentials file will be created in your volume mounted to container path /mnt/github
    The container will be automatically stopped.

  • Complete the ".credentials.txt" file
    No spaces
    If there are symbols like $ in your user and/or pass, use single quotes.

  • Restart the container

  • Run the docker container and the generated ssh key will be in the docker log.

    docker logs -f git

  • add this to your github.com account via Settings -> SSH and GPG keys

Now you can connect to the container:

docker exec -it git /bin/bash

and use commands gitpush & dockerpush
First, clone your git repository and edit/modify

git clone https://github.com/yourgituser/yourgitrepo
cd yourgitrepo

Then you can use

gitpush [comment] [tag]

e.g.

gitpush
gitpush "upgraded python" 1.3	
gitpush "adapted the README.md" main

Create your docker repository on the docker hub.
After that you can build + push from this container

dockerpush <repository>[:tag]

e.g.

dockerpush yourdockerrepo
dockerpush yourdockerrepo:1.0
dockerpush yourdockerrepo:1.1 --purge-images

Or do it all at once with push

push <docker-repository>[:docker-tag]

e.g.

push yourdockerrepo:1.0
⁠environment variables
Environment VariableKeyDescription
TZEurope/Brusselstimezone for ntpdate
⁠credentials.txt file will contain the following variables (do not add spaces!)
.credentials.txt variableDescription
GITUSERyour github username / repository name
GITMAILyour github email / signin account
DOCKERUSERyour docker user account
DOCKERPASSyour docker password
SSHPASSopenssh-server password
⁠volumes
VolumeContainer path
/host/folder/with/repos/mnt/github
/var/run/docker.sock/var/run/docker.sock
⁠ports

Optionally exposed ssh port

Host portContainer port
123422
⁠Run command
docker run -d --name='git' \
--net='bridge' \
-e TZ="Europe/Paris" \
-v '/path/on/host/':'/mnt/github':'rw' \
-v '/var/run/docker.sock':'/var/run/docker.sock':'rw' \
'trueosiris/git'

github repo: https://github.com/TrueOsiris/docker-git⁠
dockerhub repo: https://hub.docker.com/repository/docker/trueosiris/git⁠

⁠log

log arrives in /var/log/git.log.
README.md will be updated on the docker hub using peterevans/dockerhub-description, so a shoutout to him!

Tag summary

Content type

Image

Digest

sha256:2831f3123…

Size

360.2 MB

Last updated

over 3 years ago

docker pull trueosiris/git