Skip to content

Commit c931f9f

Browse files
committed
build: update dockerfiles to fix hadolint issues.
1 parent a18abe2 commit c931f9f

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

dockerfiles/cpp-20.Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
FROM gcc:12.2.0-bullseye
22

3-
RUN apt-get update
4-
RUN apt-get install -y cmake
3+
RUN apt-get update && \
4+
apt-get install --no-install-recommends -y cmake=3.18.* && \
5+
apt-get clean && \
6+
rm -rf /var/lib/apt/lists/*

dockerfiles/go-1.16.Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ RUN go mod download
1010
# Even though modules are downloaded, building them could take a while.
1111
# Let's run go get on each module so that they're built ahead of time.
1212
# Ref: https://github.com/montanaflynn/golang-docker-cache
13-
RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get
13+
RUN ash -c "set -exo pipefail; go mod graph | awk '{if (\$1 !~ \"@\") {print \$2}}' | xargs -r go get"
1414

1515
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="go.mod,go.sum"
16-

dockerfiles/go-1.19.Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ RUN go mod download
1010
# Even though modules are downloaded, building them could take a while.
1111
# Let's run go get on each module so that they're built ahead of time.
1212
# Ref: https://github.com/montanaflynn/golang-docker-cache
13-
RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get
13+
RUN ash -c "set -exo pipefail; go mod graph | awk '{if (\$1 !~ \"@\") {print \$2}}' | xargs -r go get"
1414

1515
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="go.mod,go.sum"
16-

dockerfiles/java-21.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ RUN mkdir -p /app-cached
1212
RUN mv /app/target /app-cached # Is this needed?
1313

1414
# Pre-compile steps
15-
RUN echo "cd \${CODECRAFTERS_SUBMISSION_DIR} && mvn -B package -Ddir=/tmp/codecrafters-sqlite-target && sed -i 's/^\(mvn .*\)/#\1/' ./your_sqlite3.sh" > /codecrafters-precompile.sh
16-
RUN chmod +x /codecrafters-precompile.sh
15+
RUN printf "cd \${CODECRAFTERS_SUBMISSION_DIR} && mvn -B package -Ddir=/tmp/codecrafters-sqlite-target && sed -i 's/^\(mvn .*\)/#\1/' ./your_sqlite3.sh" > /codecrafters-precompile.sh
16+
RUN chmod +x /codecrafters-precompile.sh

dockerfiles/python-3.11.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM python:3.11-alpine
22

3-
RUN pip install pipenv
3+
RUN pip install --no-cache-dir "pipenv>=2023.12.1"
44

55
COPY Pipfile /app/Pipfile
66
COPY Pipfile.lock /app/Pipfile.lock
@@ -19,4 +19,4 @@ RUN pipenv --venv
1919
RUN mkdir -p /app-cached
2020
RUN mv /app/.venv /app-cached/.venv
2121

22-
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="Pipfile,Pipfile.lock"
22+
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="Pipfile,Pipfile.lock"

dockerfiles/python-3.8.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM jfloff/alpine-python:3.8
22

3-
RUN pip install pipenv
3+
RUN pip install --no-cache-dir "pipenv>=2023.12.1"
44

55
COPY Pipfile /app/Pipfile
66
COPY Pipfile.lock /app/Pipfile.lock
@@ -19,4 +19,4 @@ RUN pipenv --venv
1919
RUN mkdir -p /app-cached
2020
RUN mv /app/.venv /app-cached/.venv
2121

22-
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="Pipfile,Pipfile.lock"
22+
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="Pipfile,Pipfile.lock"

dockerfiles/zig-0.11.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM alpine:3.18
44
RUN echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
55

66
# Update the package list and install Zig
7-
RUN apk update && apk add zig@testing=0.11.0-r3
7+
RUN apk add --no-cache zig@testing=0.11.0-r3
88

99
RUN echo "cd \${CODECRAFTERS_SUBMISSION_DIR} && zig build-exe ./app/main.zig" > /codecrafters-precompile.sh
1010
RUN chmod +x /codecrafters-precompile.sh

0 commit comments

Comments
 (0)