-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use volume to avoid having to rebuild
- Loading branch information
vilmibm
committed
Jan 27, 2021
1 parent
773c8b3
commit 7479b38
Showing
2 changed files
with
4 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,12 @@ | ||
#!/bin/bash | ||
set -e | ||
# This script: | ||
|
||
# - creates a dockerfile | ||
# - prepares a docker image that can run `createrepo` that has the latest release rpms | ||
# - "runs" the image by creating a throwaay container | ||
# - copies the result of createrepo out of the throwaway container | ||
# - destroys the throwaway container | ||
mkdir -p createrepo/dist | ||
mkdir createrepo | ||
cat > createrepo/Dockerfile << EOF | ||
FROM fedora:32 | ||
RUN yum install -y createrepo_c | ||
RUN mkdir /packages | ||
COPY dist/*.rpm /packages/ | ||
RUN createrepo /packages | ||
ENTRYPOINT ["createrepo", "/packages"] | ||
EOF | ||
|
||
cp dist/*.rpm createrepo/dist/ | ||
docker build -t createrepo createrepo/ | ||
docker create -ti --name runcreaterepo createrepo bash | ||
docker cp runcreaterepo:/packages/repodata . | ||
docker rm -f runcreaterepo | ||
docker run --rm --volume "$PWD/dist":/packages createrepo | ||
rm -rf createrepo |