Skip to content

Commit 145e6ca

Browse files
committed
feat: added the ability to update the list of repos and paths
Supports both ULN and yum.oracle.com and tries to match the yum.oracle.com URL structure as closely as possible. Signed-off-by: Avi Miller <[email protected]>
1 parent 4cea0f4 commit 145e6ca

15 files changed

+975
-579
lines changed
+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build, publish and sign the NGINX webserver image
2+
3+
4+
on:
5+
workflow_dispatch:
6+
push:
7+
branches: [ main ]
8+
tags: [ 'v*.*.*' ]
9+
10+
11+
env:
12+
REGISTRY: ghcr.io
13+
IMAGE_NAME: djelibeybi/ol-repo-webserver
14+
15+
16+
jobs:
17+
build:
18+
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
packages: write
23+
id-token: write
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v2
28+
29+
- name: Install cosign
30+
if: github.event_name != 'pull_request'
31+
uses: sigstore/cosign-installer@1e95c1de343b5b0c23352d6417ee3e48d5bcd422
32+
with:
33+
cosign-release: 'v1.4.0'
34+
35+
- name: Setup Docker buildx
36+
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
37+
38+
- name: Log into registry ${{ env.REGISTRY }}
39+
if: github.event_name != 'pull_request'
40+
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
41+
with:
42+
registry: ${{ env.REGISTRY }}
43+
username: ${{ github.actor }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Extract Docker metadata
47+
id: meta
48+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
49+
with:
50+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
51+
52+
- name: Build and push Docker image
53+
id: build-and-push
54+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
55+
with:
56+
context: .
57+
file: ./Dockerfile.nginx
58+
platforms: linux/amd64,linux/arm64
59+
push: ${{ github.event_name != 'pull_request' }}
60+
tags: ${{ steps.meta.outputs.tags }}
61+
labels: ${{ steps.meta.outputs.labels }}
62+
63+
- name: Sign the published Docker image
64+
if: ${{ github.event_name != 'pull_request' }}
65+
env:
66+
COSIGN_EXPERIMENTAL: "true"
67+
run: cosign sign ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.build-and-push.outputs.digest }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Build, publish and sign the reposync image
2+
3+
4+
on:
5+
workflow_dispatch:
6+
push:
7+
branches: [ main ]
8+
tags: [ 'v*.*.*' ]
9+
10+
11+
env:
12+
REGISTRY: ghcr.io
13+
IMAGE_NAME: djelibeybi/ol-repo-sync
14+
15+
16+
jobs:
17+
build:
18+
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
packages: write
23+
id-token: write
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v2
28+
29+
- name: Install cosign
30+
if: github.event_name != 'pull_request'
31+
uses: sigstore/cosign-installer@1e95c1de343b5b0c23352d6417ee3e48d5bcd422
32+
with:
33+
cosign-release: 'v1.4.0'
34+
35+
- name: Setup Docker buildx
36+
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
37+
38+
- name: Log into registry ${{ env.REGISTRY }}
39+
if: github.event_name != 'pull_request'
40+
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
41+
with:
42+
registry: ${{ env.REGISTRY }}
43+
username: ${{ github.actor }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Extract Docker metadata
47+
id: meta
48+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
49+
with:
50+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
51+
52+
- name: Build and push Docker image
53+
id: build-and-push
54+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
55+
with:
56+
context: .
57+
platforms: linux/amd64,linux/arm64
58+
push: ${{ github.event_name != 'pull_request' }}
59+
tags: ${{ steps.meta.outputs.tags }}
60+
labels: ${{ steps.meta.outputs.labels }}
61+
62+
- name: Sign the published Docker image
63+
if: ${{ github.event_name != 'pull_request' }}
64+
env:
65+
COSIGN_EXPERIMENTAL: "true"
66+
run: cosign sign ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.build-and-push.outputs.digest }}

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ security related. When filing a bug remember that the better written the bug is,
99
the more likely it is to be fixed.
1010

1111
If you think you've found a security vulnerability, do not raise a GitHub issue.
12-
Please email <sec@dje.li> directly. You may chose to encrypt your email using
13-
our [public GPG key](./gpg-key.asc)
12+
Please email <security@dje.li> directly. You may chose to encrypt your email using
13+
[my public GPG key](./gpg-key.asc)
1414

1515
## Pull request process
1616

Dockerfile

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
# Copyright (c) 2020, 2021 Avi Miller.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3-
FROM oraclelinux:8-slim
3+
FROM ghcr.io/oracle/oraclelinux8-python:3.9
44

5-
# Install and enable the ULN client then disable the default repos from yum.oracle.com
6-
RUN microdnf install dnf jq && \
7-
echo > /etc/dnf/vars/ociregion && \
8-
dnf -y module install satellite-5-client && \
9-
sed -i.bak -z 's/\[main\]\nenabled = 0/\[main\]\nenabled = 1/' /etc/dnf/plugins/spacewalk.conf && \
10-
dnf config-manager --disable ol8_baseos_latest --disable ol8_appstream && \
11-
dnf clean all
5+
RUN echo > /etc/dnf/vars/ociregion && \
6+
dnf -y module enable satellite-5-client && \
7+
dnf -y install cpio jq dnf-plugin-spacewalk python3-dnf-plugin-ulninfo rhn-setup rhnlib rhnsd rhn-client-tools tar && \
8+
sed -i.bak -z 's/\[main\]\nenabled = 0/\[main\]\nenabled = 1/' /etc/dnf/plugins/spacewalk.conf && \
9+
dnf clean all
10+
11+
COPY rootfs/ /
1212

13-
COPY /config/repo-map.json /config/
14-
COPY entrypoint.sh /
1513
RUN chmod +x /entrypoint.sh
1614

1715
ENTRYPOINT ["/entrypoint.sh"]

Dockerfile.nginx

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2020, 2021 Avi Miller.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
FROM oraclelinux:8-slim
4+
5+
RUN microdnf module disable php && \
6+
microdnf module enable nginx:1.20 && \
7+
microdnf install nginx && \
8+
microdnf clean all && \
9+
ln -sf /dev/stdout /var/log/nginx/access.log && \
10+
ln -sf /dev/stderr /var/log/nginx/error.log && \
11+
sed -i 's/\/usr\/share\/nginx\/html;/\/var\/www\/html;/' /etc/nginx/nginx.conf
12+
13+
STOPSIGNAL SIGQUIT
14+
15+
EXPOSE 80/tcp
16+
EXPOSE 443/tcp
17+
18+
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)