Skip to content

Commit a8ff2ba

Browse files
authored
Remove alpine base images (#59)
* Remove alpine base images from challenge templates * Fix up a few miscellaneous issues * Closes #50
1 parent 662ad51 commit a8ff2ba

File tree

5 files changed

+17
-22
lines changed

5 files changed

+17
-22
lines changed

ctfcli/templates/programming/default/{{cookiecutter.name}}/Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
FROM python:3.7-alpine
1+
FROM python:3.7-slim-buster
2+
3+
RUN apt-get update -y \
4+
&& apt-get install --no-install-recommends -y socat \
5+
&& apt-get clean \
6+
&& rm -rf /var/lib/apt/lists/*
27

3-
RUN apk update && \
4-
apk add \
5-
socat
68
RUN mkdir "/opt/{{cookiecutter.name}}"
79
COPY ./src/* "/opt/{{cookiecutter.name}}/"
810
RUN pip install -r "/opt/{{cookiecutter.name}}/requirements.txt"

ctfcli/templates/programming/default/{{cookiecutter.name}}/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ services:
33
app:
44
build: .
55
ports:
6-
- '8000:8000'
6+
- '{{cookiecutter.port}}'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
six==1.16.0

ctfcli/templates/web/default/{{cookiecutter.name}}/Dockerfile

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
1-
FROM python:3.7-alpine
2-
RUN apk update && \
3-
apk add \
4-
python3-dev \
5-
linux-headers \
6-
libffi-dev \
7-
gcc \
8-
make \
9-
musl-dev \
10-
py-pip \
11-
mysql-client \
12-
git \
13-
openssl-dev
14-
RUN adduser -D -u 1001 -s /bin/bash app
15-
1+
FROM python:3.7-slim-buster
2+
RUN adduser \
3+
--disabled-login \
4+
-u 1001 \
5+
--gecos "" \
6+
--shell /bin/bash \
7+
app
168
WORKDIR /opt/app
179
RUN mkdir -p /opt/app
1810

1911
COPY src/ /opt/app/
20-
2112
RUN pip install -r requirements.txt
22-
RUN chmod +x /opt/app/serve.sh
13+
RUN chown -R 1001:1001 /opt/app && chmod -R 755 /opt/app
2314

2415
USER 1001
2516
EXPOSE 8000

ctfcli/templates/web/default/{{cookiecutter.name}}/src/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ gunicorn==20.0.4
22
Flask==1.1.1
33
Bootstrap-Flask==1.2.0
44
Flask-SQLAlchemy==2.4.4
5+
SQLAlchemy==1.3.17

0 commit comments

Comments
 (0)