Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dockerfiles #1374

Merged
merged 2 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ jobs:
- name: "Check out NIPAP repository"
uses: actions/checkout@v2

- name: "Hadolint nipapd"
uses: hadolint/[email protected]
with:
Dockerfile: Dockerfile.nipapd

- name: "Hadolint WWW"
uses: hadolint/[email protected]
with:
Dockerfile: Dockerfile.www

- name: "Install dependencies and prepare NIPAP"
run: |
# Set up NIPAP repo
Expand Down
6 changes: 6 additions & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
failure-threshold: warning
override:
info:
- DL3003
- DL3008
- DL4000
31 changes: 14 additions & 17 deletions Dockerfile.nipapd
Original file line number Diff line number Diff line change
Expand Up @@ -32,41 +32,38 @@
# via a volume.
#

FROM ubuntu:bionic
FROM ubuntu:jammy
MAINTAINER Kristian Larsson <[email protected]>

Check failure on line 36 in Dockerfile.nipapd

View workflow job for this annotation

GitHub Actions / test (pip, false)

DL4000 info: MAINTAINER is deprecated

Check failure on line 36 in Dockerfile.nipapd

View workflow job for this annotation

GitHub Actions / test (apt, true)

DL4000 info: MAINTAINER is deprecated

Check failure on line 36 in Dockerfile.nipapd

View workflow job for this annotation

GitHub Actions / test (apt, false)

DL4000 info: MAINTAINER is deprecated

ENV DEBIAN_FRONTEND=noninteractive

# apt update, upgrade & install packages
RUN apt-get update -qy && apt-get upgrade -qy \

Check failure on line 41 in Dockerfile.nipapd

View workflow job for this annotation

GitHub Actions / test (pip, false)

DL3008 info: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`

Check failure on line 41 in Dockerfile.nipapd

View workflow job for this annotation

GitHub Actions / test (pip, false)

DL3009 info: Delete the apt-get lists after installing something

Check failure on line 41 in Dockerfile.nipapd

View workflow job for this annotation

GitHub Actions / test (apt, true)

DL3008 info: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`

Check failure on line 41 in Dockerfile.nipapd

View workflow job for this annotation

GitHub Actions / test (apt, true)

DL3009 info: Delete the apt-get lists after installing something

Check failure on line 41 in Dockerfile.nipapd

View workflow job for this annotation

GitHub Actions / test (apt, false)

DL3008 info: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`

Check failure on line 41 in Dockerfile.nipapd

View workflow job for this annotation

GitHub Actions / test (apt, false)

DL3009 info: Delete the apt-get lists after installing something
&& apt-get install -qy devscripts \
make \
&& apt-get install --no-install-recommends -qy build-essential \
libpq-dev \
libldap-dev \
libsasl2-dev \
libsqlite3-dev \
postgresql-client \
software-properties-common \
python3 \
python3-all \
python3-pip \
python3-dev \
libsasl2-dev \
libldap2-dev \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
python3-pip \
software-properties-common \
&& apt-get clean

# Install any additional CA certs from ca_certs folder required by corp proxies etc
RUN mkdir -p /usr/share/ca-certificates/extra
COPY ca_certs/*.crt /usr/share/ca-certificates/extra/
RUN ls /usr/share/ca-certificates/extra/*.crt | sed 's/\/usr\/share\/ca-certificates\///g' >> /etc/ca-certificates.conf
RUN update-ca-certificates
RUN pip3 install --upgrade pip
COPY ca_certs/ /
RUN mkdir -p /usr/local/share/ca-certificates \
&& cp /ca_certs/*.crt /usr/local/share/ca-certificates/ || true \
&& rm -rf /ca_certs \
&& update-ca-certificates
RUN pip3 config set global.cert /etc/ssl/certs/ca-certificates.crt


COPY nipap /nipap
WORKDIR /nipap
RUN pip3 install --no-input envtpl
RUN pip3 --no-input install -r requirements.txt \
RUN pip3 --no-input install --no-cache-dir envtpl==0.7.2 \
&& pip3 --no-input install --no-cache-dir -r requirements.txt \
&& python3 setup.py install

EXPOSE 1337
Expand Down
34 changes: 17 additions & 17 deletions Dockerfile.www
Original file line number Diff line number Diff line change
Expand Up @@ -23,38 +23,38 @@
# database so that you can later login to the web interface.
#

FROM ubuntu:xenial
FROM ubuntu:jammy

MAINTAINER Lukas Garberg <[email protected]>

Check failure on line 28 in Dockerfile.www

View workflow job for this annotation

GitHub Actions / test (pip, false)

DL4000 info: MAINTAINER is deprecated

Check failure on line 28 in Dockerfile.www

View workflow job for this annotation

GitHub Actions / test (apt, true)

DL4000 info: MAINTAINER is deprecated

Check failure on line 28 in Dockerfile.www

View workflow job for this annotation

GitHub Actions / test (apt, false)

DL4000 info: MAINTAINER is deprecated

ENV DEBIAN_FRONTEND=noninteractive

ENV NIPAPD_HOST=nipapd NIPAPD_PORT=1337 WWW_USERNAME=guest WWW_PASSWORD=guest

# apt update, upgrade & install packages
RUN apt-get update -qy && apt-get upgrade -qy \

Check failure on line 35 in Dockerfile.www

View workflow job for this annotation

GitHub Actions / test (pip, false)

DL3008 info: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`

Check failure on line 35 in Dockerfile.www

View workflow job for this annotation

GitHub Actions / test (pip, false)

DL3009 info: Delete the apt-get lists after installing something

Check failure on line 35 in Dockerfile.www

View workflow job for this annotation

GitHub Actions / test (apt, true)

DL3008 info: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`

Check failure on line 35 in Dockerfile.www

View workflow job for this annotation

GitHub Actions / test (apt, true)

DL3009 info: Delete the apt-get lists after installing something

Check failure on line 35 in Dockerfile.www

View workflow job for this annotation

GitHub Actions / test (apt, false)

DL3008 info: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`

Check failure on line 35 in Dockerfile.www

View workflow job for this annotation

GitHub Actions / test (apt, false)

DL3009 info: Delete the apt-get lists after installing something
&& apt-get install -qy apache2 \
libapache2-mod-wsgi \
devscripts \
make \
&& apt-get install --no-install-recommends -qy apache2 \
build-essential \
libapache2-mod-wsgi-py3 \
libpq-dev \
libldap-dev \
libsasl2-dev \
libsqlite3-dev \
postgresql-client \
python \
python-all \
python-docutils \
python-pip \
python-dev \
python-markupsafe \
python-jinja2 \
&& pip --no-input install envtpl \
&& rm -rf /var/lib/apt/lists/*
python3 \
python3-all \
python3-pip \
python3-dev \
&& pip3 --no-input install --no-cache-dir envtpl==0.7.2 \
&& apt-get clean

# Install pynipap, nipap and nipap-www
COPY pynipap /pynipap
COPY nipap /nipap
COPY nipap-www /nipap-www
RUN cd /pynipap && python setup.py install && \
cd /nipap && pip --no-input install -r requirements.txt && python setup.py install && \
cd /nipap-www && pip --no-input install -r requirements.txt && python setup.py install && \
RUN cd /pynipap && python3 setup.py install && \

Check failure on line 55 in Dockerfile.www

View workflow job for this annotation

GitHub Actions / test (pip, false)

DL3003 info: Use WORKDIR to switch to a directory

Check failure on line 55 in Dockerfile.www

View workflow job for this annotation

GitHub Actions / test (apt, true)

DL3003 info: Use WORKDIR to switch to a directory

Check failure on line 55 in Dockerfile.www

View workflow job for this annotation

GitHub Actions / test (apt, false)

DL3003 info: Use WORKDIR to switch to a directory
cd /nipap && pip3 --no-input install --no-cache-dir -r requirements.txt && python3 setup.py install && \
cd /nipap-www && pip3 --no-input install --no-cache-dir -r requirements.txt && python3 setup.py install && \
cd ..

EXPOSE 80
Expand Down
4 changes: 0 additions & 4 deletions nipap-www/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ if [ `nipap-passwd list | egrep -c ^$WWW_USERNAME\\\s` -eq 0 ]; then
/usr/sbin/nipap-passwd add -u $WWW_USERNAME -p $WWW_PASSWORD -n "NIPAP WWW user" -t
fi

# Fix permissions
chown -R www-data:www-data /var/cache/nipap-www
chmod -R u=rwX /var/cache/nipap-www

# Configure apache
cat << EOF > /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
Expand Down
Loading