Skip to content

Commit

Permalink
docs: docker information
Browse files Browse the repository at this point in the history
  • Loading branch information
Coenraad Human committed May 23, 2024
1 parent 81a046d commit 499674e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ RUN \
apk upgrade && \
apk add --no-cache bash sed shadow setpriv && \
rm /var/cache/apk/* && \
# Preferred on pipelines:
# Preferred shell on pipelines:
chsh -s $(which bash) && \
# Required so we can ensure that gib and bash runs with correct Linux privilege for the mounted repository:
# Required so we can ensure that gib and bash runs with correct Linux privilege as the mounted repository:
chmod +s $(which setpriv)

# Avoid Git security issues since end user is explicity mounting repository:
# Avoid Git security since end user is explicity mounting repository:
RUN \
echo '[safe]' > /etc/gitconfig && \
echo ' directory = *' /etc/gitconfig
Expand All @@ -36,7 +36,7 @@ COPY --from=builder /usr/bin/gib /usr/bin/gib
COPY --from=builder /build/.docker/gib-entrypoint.sh /usr/bin/gib-entrypoint.sh
COPY --from=builder /build/.docker/bash-entrypoint.sh /usr/bin/bash-entrypoint.sh

# Run bash with the same Linux privilege for the mounted repository:
# Run bash with the same Linux privilege as the mounted repository:
RUN cd /bin && mv bash real-bash && ln -s /usr/bin/bash-entrypoint.sh bash

WORKDIR /app
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ Some notes regarding using `gib` with docker:
- [Dockerhub](https://hub.docker.com/repository/docker/coenraadhuman/gib/general) - `docker pull coenraadhuman/gib:latest`
- [Github Packages](https://github.com/coenraadhuman/gib/pkgs/container/gib) - `docker pull ghcr.io/coenraadhuman/gib:latest`
By default the work directory is set to `/app` this can be changed with the `-w` option on `docker run`. It is important to update this when mounting to a different directory since the entry point for the container relies on the working directory to ensure bash and gib runs with the correct Linux permissions.
Run Example:
```bash
# The default work directory is /app
Expand Down

0 comments on commit 499674e

Please sign in to comment.