docker-code-server/Dockerfile
Gabe Mendoza c8a8ee928e
[CIVIS-11019] update to use ubuntu 22.04 fips enabled base image (#1)
* ubuntu fips

* Improve Dockerfile formatting and readability

- Use consistent 2-space indentation throughout
- Remove unnecessary comment blocks
- Better organize ARG declarations
- Improve line continuation formatting

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>

* remove extraneous file

* remove jenkins things

* remove extra files

* Add docker-compose configuration for FIPS-compliant code-server

- Add docker-compose.yml with build args for VERSION and CODE_RELEASE
- Add .env.example with configurable environment variables
- Update .gitignore and .dockerignore to exclude .env files
- Set CODE_RELEASE default to 4.102.1 for stable builds
- Configure image name: gabemendoza1/codecloud-code-server

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>

* simplify

* update image

* update image

* update image

* add netcat-openbsd

* netcat

* default ids 0

* remove extra files

* remove more workflows

* upgrade Python to 3.12

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>

* add buildspec

* update buildspec defs

* update buildspec defs

* ubuntu-fips-2

* fixed buildspec args

* FIPS_REPOSITORY_URI

* styling

* update placeholders

* latest

* latest

* put that thing back where it came from or so help me

* only need 1

* simplify Dockerfile

* no need ignores

* no need ignores

* simplify

* remove comment

* trigger codebuild

* jammy

---------

Co-authored-by: opencode <noreply@opencode.ai>
2025-07-25 13:11:33 -05:00

85 lines
2.6 KiB
Docker
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# syntax=docker/dockerfile:1
ARG ECR_ACCOUNT_ID
ARG ECR_REGION=us-east-1
ARG BASE_IMAGE_NAME=docker-linuxserver-ubuntu-fips
ARG BASE_IMAGE_TAG=jammy
ARG ECR_URI=${ECR_ACCOUNT_ID}.dkr.ecr-fips.${ECR_REGION}.amazonaws.com/${BASE_IMAGE_NAME}:${BASE_IMAGE_TAG}
FROM ${ECR_URI} as docker-code-server-python
ARG DEBIAN_FRONTEND="noninteractive"
# Install Python 3.12
RUN echo "**** install Python 3.12 ****" && \
apt-get update && \
apt-get install -y \
software-properties-common \
gpg-agent && \
curl -fsSL https://keyserver.ubuntu.com/pks/lookup?op=get\&search=0xF23C5A6CF475977595C89F51BA6932366A755776 | apt-key add - && \
echo "deb https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy main" > /etc/apt/sources.list.d/deadsnakes.list && \
apt-get update && \
apt-get install -y \
python3.12 \
python3.12-dev \
python3.12-venv && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 && \
update-alternatives --install /usr/bin/python python /usr/bin/python3.12 1 && \
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.12 && \
pip3 install --upgrade pip setuptools wheel && \
python3 --version && \
pip3 --version && \
echo "**** clean up ****" && \
apt-get clean && \
rm -rf \
/var/lib/apt/lists/* \
/tmp/*
FROM docker-code-server-python
ARG BUILD_DATE
ARG VERSION
ARG CODE_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="civisanalytics"
# environment settings
ARG DEBIAN_FRONTEND="noninteractive"
ENV HOME="/config"
RUN \
echo "**** install runtime dependencies ****" && \
apt-get update && \
apt-get install -y \
git \
libatomic1 \
nano \
net-tools \
netcat-openbsd \
sudo && \
echo "**** install code-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \
CODE_RELEASE=$(curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest \
| awk '/tag_name/{print $4;exit}' FS='[""]' | sed 's|^v||'); \
fi && \
mkdir -p /app/code-server && \
curl -o \
/tmp/code-server.tar.gz -L \
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server-${CODE_RELEASE}-linux-amd64.tar.gz" && \
tar xf /tmp/code-server.tar.gz -C \
/app/code-server --strip-components=1 && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
echo "**** clean up ****" && \
apt-get clean && \
rm -rf \
/config/* \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# add local files
COPY /root /
# ports and volumes
EXPOSE 8443