Skip to content

Commit 8ebf7f8

Browse files
thatguyinabeanieopencode
andauthored
[CIVIS-11019] ubuntu 22.04 fips enabled base image for linuxserver (#1)
* PR template * remove jenkins things * remove source list files * remove extra files * remove extra files * Refactor Dockerfile to use FIPS-compliant base image - Replace multi-stage build with gabemendoza1/cloudcode-baseimage-ubuntu-fips:jammy-22.04 - Remove Ubuntu Cloud Image extraction and Alpine stage - Remove sources.list copy (already configured in base image) - Add s6-overlay installation for LinuxServer.io compatibility - Add LinuxServer.io mod scripts (docker-mods, package-install, lsiown) - Conditionally create abc user (911:911) if not exists - Maintain full LinuxServer.io ecosystem on FIPS foundation 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <[email protected]> * cleanup docker compose * reduce * python * save * save * optmized installs * remove more workflows * remove Python dependencies from Ubuntu FIPS base image 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <[email protected]> * build in codebuild * fixed buildspec * update merge_master.yaml and release.yaml * docker build kit * remove echos * set ecr image tag name and related things * update buildspec defs * base image name * remove extra compose args * simplify buildspecs * styling * remove .env.example * move build policy up * save * /config * /root * simplify Dockerfile * update placeholders * latest * fixed buildspec yamls * disable chowning of /config * fix pr template --------- Co-authored-by: opencode <[email protected]>
1 parent 5b7a623 commit 8ebf7f8

File tree

18 files changed

+155
-1633
lines changed

18 files changed

+155
-1633
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,38 @@
1-
<!--- Provide a general summary of your changes in the Title above -->
1+
## Description
22

3-
[linuxserverurl]: https://linuxserver.io
4-
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl]
3+
Required: Please provide a brief description of what this pull request is trying to accomplish.
54

5+
>
66
7-
<!--- Before submitting a pull request please check the following -->
7+
## Context, Consequences, & Considerations
88

9-
<!--- If this is a fix for a typo (in code, documentation, or the README) please file an issue and let us sort it out. We do not need a PR -->
10-
<!--- Ask yourself if this modification is something the whole userbase will benefit from, if this is a specific change for corner case functionality or plugins please look at making a Docker Mod or local script https://blog.linuxserver.io/2019/09/14/customizing-our-containers/ -->
11-
<!--- That if the PR is addressing an existing issue include, closes #<issue number> , in the body of the PR commit message -->
12-
<!--- You have included links to any files / patches etc your PR may be using in the body of the PR commit message -->
13-
<!--- We maintain a changelog of major revisions to the container at the end of readme-vars.yml in the root of this repository, please add your changes there if appropriate -->
9+
Required: Please step through the following list, pausing at each item to consider your change in relation to the item's context.
10+
Check the box to mark that it applies, and enter your relevant notes under the item.
1411

12+
- [ ] Security: This has security implications. This includes (but not limited to) adding users, modifying user/app permissions, network rules/policies, changing a system interconnection, or changing an authorization strategy.
13+
- [ ] This PR does not require security review. These changes are part of a project plan that has already undergone security review. The link is provided below.
14+
- [ ] This PR requires security review. Add the `security` label to this PR then request a review from the [Security Code Reviewers Team](https://github.com/orgs/civisanalytics/teams/security-code-reviewers).
1515

16-
<!--- Coding guidelines: -->
17-
<!--- 1. Installed packages in the Dockerfiles should be in alphabetical order -->
18-
<!--- 2. Changes to Dockerfile should be replicated in Dockerfile.armhf and Dockerfile.aarch64 if applicable -->
19-
<!--- 3. Indentation style (tabs vs 4 spaces vs 1 space) should match the rest of the document -->
20-
<!--- 4. Readme is auto generated from readme-vars.yml, make your changes there -->
16+
>
2117
22-
------------------------------
18+
- [ ] Execution: This change requires commands to be run outside of the normal merge.
2319

24-
- [ ] I have read the [contributing](https://github.com/linuxserver/docker-baseimage-ubuntu/blob/jammy/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications
20+
>
2521
26-
------------------------------
22+
- [ ] Impact: This change may cause service interruptions.
2723

28-
<!--- We welcome all PR’s though this doesn’t guarantee it will be accepted. -->
24+
>
2925
30-
## Description:
31-
<!--- Describe your changes in detail -->
26+
- [ ] Testing: How did you test this change (unit tests, acceptance tests, etc.)? Did you do any manual testing?
3227

33-
## Benefits of this PR and context:
34-
<!--- Please explain why we should accept this PR. If this fixes an outstanding bug, please reference the issue # -->
28+
>
3529
36-
## How Has This Been Tested?
37-
<!--- Please describe in detail how you tested your changes. -->
38-
<!--- Include details of your testing environment, and the tests you ran to -->
39-
<!--- see how your change affects other areas of the code, etc. -->
30+
- [ ] Testing: How will you confirm this change once it's merged?
4031

32+
>
4133
42-
## Source / References:
43-
<!--- Please include any forum posts/github links relevant to the PR -->
34+
- [ ] Documentation: Documentation to reflect this change has been added to Confluence or Zendesk.
35+
36+
>
37+
38+
- [ ] **All items of the checklist have been considered and this PR description is complete.**

.github/workflows/call_issue_pr_tracker.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/call_issues_cron.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/greetings.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ Network Trash Folder
4242
Temporary Items
4343
.apdisk
4444
.jenkins-external
45+
.env

Dockerfile

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,58 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM alpine:3 as rootfs-stage
3+
# ECR and base image configuration - extracted from CodeBuild environment
4+
ARG ECR_ACCOUNT_ID
5+
ARG ECR_REGION=us-east-1
6+
ARG BASE_IMAGE_NAME=civis-ubuntu-fips
7+
ARG BASE_IMAGE_TAG=22.04
8+
ARG ECR_URI=${ECR_ACCOUNT_ID}.dkr.ecr-fips.${ECR_REGION}.amazonaws.com/${BASE_IMAGE_NAME}:${BASE_IMAGE_TAG}
9+
10+
FROM ${ECR_URI} as ubuntu-fips-s6
411

5-
# environment
612
ENV REL=jammy
713
ENV ARCH=amd64
814

9-
# install packages
10-
RUN \
11-
apk add --no-cache \
12-
bash \
13-
curl \
14-
tzdata \
15-
xz
16-
17-
# grab base tarball
18-
RUN \
19-
mkdir /root-out && \
20-
curl -o \
21-
/rootfs.tar.gz -L \
22-
https://partner-images.canonical.com/core/${REL}/current/ubuntu-${REL}-core-cloudimg-${ARCH}-root.tar.gz && \
23-
tar xf \
24-
/rootfs.tar.gz -C \
25-
/root-out && \
26-
rm -rf \
27-
/root-out/var/log/*
28-
29-
# set version for s6 overlay
3015
ARG S6_OVERLAY_VERSION="3.1.6.2"
3116
ARG S6_OVERLAY_ARCH="x86_64"
3217

18+
# Install base development tools (no Python)
19+
RUN apt-get update && apt-get install -y \
20+
curl \
21+
tzdata \
22+
build-essential \
23+
libpq-dev \
24+
git \
25+
ca-certificates \
26+
openssl \
27+
xz-utils \
28+
libssl-dev && \
29+
# Clean up
30+
rm -rf /var/lib/apt/lists/* && \
31+
# Update CA certificates to ensure SSL/TLS works properly
32+
update-ca-certificates
33+
3334
# add s6 overlay
3435
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
35-
RUN tar -C /root-out -Jxpf /tmp/s6-overlay-noarch.tar.xz
36+
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
3637
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz /tmp
37-
RUN tar -C /root-out -Jxpf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz
38+
RUN tar -C / -Jxpf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz
3839

3940
# add s6 optional symlinks
4041
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz /tmp
41-
RUN tar -C /root-out -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz
42+
RUN tar -C / -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz
4243
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz /tmp
43-
RUN tar -C /root-out -Jxpf /tmp/s6-overlay-symlinks-arch.tar.xz
44+
RUN tar -C / -Jxpf /tmp/s6-overlay-symlinks-arch.tar.xz
45+
46+
FROM ubuntu-fips-s6 as linuxserver-base
4447

45-
# Runtime stage
46-
FROM scratch
47-
COPY --from=rootfs-stage /root-out/ /
4848
ARG BUILD_DATE
4949
ARG VERSION
5050
ARG MODS_VERSION="v3"
5151
ARG PKG_INST_VERSION="v1"
5252
ARG LSIOWN_VERSION="v1"
53+
5354
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
54-
LABEL maintainer="TheLamer"
55+
LABEL maintainer="civisanalytics"
5556

5657
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" "/docker-mods"
5758
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install.${PKG_INST_VERSION}" "/etc/s6-overlay/s6-rc.d/init-mods-package-install/run"
@@ -69,9 +70,6 @@ ENV HOME="/root" \
6970
VIRTUAL_ENV=/lsiopy \
7071
PATH="/lsiopy/bin:$PATH"
7172

72-
# copy sources
73-
COPY sources.list /etc/apt/
74-
7573
RUN \
7674
echo "**** Ripped from Ubuntu Docker Logic ****" && \
7775
set -xe && \
@@ -129,7 +127,8 @@ RUN \
129127
/app \
130128
/config \
131129
/defaults \
132-
/lsiopy && \
130+
/lsiopy \
131+
/workspace && \
133132
echo "**** cleanup ****" && \
134133
apt-get autoremove && \
135134
apt-get clean && \

Dockerfile.aarch64

Lines changed: 0 additions & 150 deletions
This file was deleted.

0 commit comments

Comments
 (0)