ironpeakservices / iron-alpine

Hardened alpine linux baseimage for Docker.
https://github.com/ironPeakServices/iron-alpine
Apache License 2.0
131 stars 12 forks source link

Image environment completely reset in derived image #19

Closed frederikbosch closed 4 years ago

frederikbosch commented 4 years ago

The variables set in this repository's image are not available anymore. This happened last few days. I guess commit c4e363ce46a81e0b2eac1aed1595bcfeedaf61ba is causing the problem. The problem is happening in my CI/CD builds but also local builds.

# no problem
FROM docker.pkg.github.com/ironpeakservices/iron-alpine/iron-alpine:3.11.0

# problem
FROM docker.pkg.github.com/ironpeakservices/iron-alpine/iron-alpine:3.11.3
FROM docker.pkg.github.com/ironpeakservices/iron-alpine/iron-alpine:3.11.5

RUN echo $CONF_DIR && echo $DATA_DIR && echo $APP_DIR && printenv
hazcod commented 4 years ago

Fixed in https://github.com/ironPeakServices/iron-alpine/commit/2d86377a8dec685d3ca34dfdb40d39cf0d7abeaa Sorry for the issue! Can you try again by re-pulling those versions?

frederikbosch commented 4 years ago

Fixed. Btw, I am testing all my images with Goss and my goss.yml file looks as follows. It might be an idea to use it.

file:
  /app/conf:
    exists: true
    owner: app
    group: app
    mode: "0700"
  /app/data:
    exists: true
    owner: app
    group: app
    mode: "0700"

command:
  env_app_dir:
    exit-status: 0
    exec: "echo $APP_DIR"
    stdout:
      - /app
  env_conf_dir:
    exit-status: 0
    exec: "echo $CONF_DIR"
    stdout:
      - /app/conf
  env_data_dir:
    exit-status: 0
    exec: "echo $DATA_DIR"
    stdout:
      - /app/data
  pwd:
    exit-status: 0
    exec: "echo $PWD"
    stdout:
      - /app