Skip to content

Commit

Permalink
Fixes from usage (#45)
Browse files Browse the repository at this point in the history
Various fixes from usage on a project:
1. Load dynamic entrypoint when in dev mode to fix permissions issues on
linux
2. Install iproute2 to provide /usr/sbin/ip
3. Fix path to ip based on bookworm docker images
4. Move test stage in jenkins to match docker harness
5. Upgrade to alpine 3.18 for nginx (and track maintained version) as
CVE for curl not patched
  • Loading branch information
kierenevans authored Mar 22, 2024
1 parent 5789efb commit b0a2074
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions _twig/docker-compose.yml/service/app.yml.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ services:
{% if @('app.build') == 'dynamic' %}
target: node
command: ["app", "start:dev"]
entrypoint: [/entrypoint.dynamic.sh]
stdin_open: true # react-scripts start terminates if stdin closed
volumes:
- {{ (syncvolume) ? @('workspace.name') ~ '-sync:/app:nocopy' : ('./:/app' ~ @('docker.compose.host_volume_options')) }}
Expand Down
5 changes: 5 additions & 0 deletions docker/image/app/Dockerfile.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
FROM console as node
COPY .my127ws/docker/image/app/root-node /

RUN apt-get update && apt-get install --no-install-recommends -y iproute2 \
&& apt-get auto-remove -qq -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

FROM {{ @('services.app.build.from.nginx') }} as nginx

RUN apk add --no-cache jq
Expand Down
2 changes: 1 addition & 1 deletion docker/image/app/root-node/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ setup_app_networking()
if [ "${HOST_OS_FAMILY}" = "linux" ]; then
DOCKER_INTERNAL_HOST="host.docker.internal"
if ! grep $DOCKER_INTERNAL_HOST /etc/hosts > /dev/null ; then
DOCKER_INTERNAL_IP=$(/sbin/ip route|awk '/default/ { print $3 }')
DOCKER_INTERNAL_IP=$(/usr/sbin/ip route|awk '/default/ { print $3 }')
echo -e "$DOCKER_INTERNAL_IP $DOCKER_INTERNAL_HOST" | tee -a /etc/hosts > /dev/null
fi
fi
Expand Down
4 changes: 2 additions & 2 deletions harness/attributes/docker-spa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ attributes.default:
build:
from:
node: = 'node:' ~ @('node.version') ~ '-slim'
nginx: nginx:1.25-alpine3.17
nginx: nginx:1.25-alpine
environment:
HOST_OS_FAMILY: = @('host.os')
resources:
Expand All @@ -16,7 +16,7 @@ attributes.default:
build:
from: = 'node:' ~ @('node.version') ~ '-slim'
publish: false

pipeline:
base:
ingresses:
Expand Down

0 comments on commit b0a2074

Please sign in to comment.