Skip to content

Commit

Permalink
Fix chmod in startup.sh
Browse files Browse the repository at this point in the history
Use 1000:1000 by default if HOST_UID/HOST_GID are not set (e.g. in PWD environments)
  • Loading branch information
lmakarov committed Jun 2, 2018
1 parent a13bb6a commit 3f1e897
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions 5.6/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ render_tmpl "$HOME_DIR/.acquia/cloudapi.conf"
# Make sure permissions are correct (after uid/gid change and COPY operations in Dockerfile)
# To not bloat the image size, permissions on the home folder are reset at runtime.
echo-debug "Resetting permissions on $HOME_DIR and /var/www..."
chown "$HOST_UID:$HOST_GID" -R "$HOME_DIR"
chown "${HOST_UID-:1000}:${HOST_GID:-1000}" -R "$HOME_DIR"
# Docker resets the project root folder permissions to 0:0 when cli is recreated (e.g. an env variable updated).
# We apply a fix/workaround for this at startup.
chown "$HOST_UID:$HOST_GID" /var/www
# We apply a fix/workaround for this at startup (non-recursive).
chown "${HOST_UID-:1000}:${HOST_GID:-1000}" /var/www

# Initialization steps completed. Create a pid file to mark the container as healthy
echo-debug "Preliminary initialization completed"
Expand Down
6 changes: 3 additions & 3 deletions 7.0/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ render_tmpl "$HOME_DIR/.acquia/cloudapi.conf"
# Make sure permissions are correct (after uid/gid change and COPY operations in Dockerfile)
# To not bloat the image size, permissions on the home folder are reset at runtime.
echo-debug "Resetting permissions on $HOME_DIR and /var/www..."
chown "$HOST_UID:$HOST_GID" -R "$HOME_DIR"
chown "${HOST_UID-:1000}:${HOST_GID:-1000}" -R "$HOME_DIR"
# Docker resets the project root folder permissions to 0:0 when cli is recreated (e.g. an env variable updated).
# We apply a fix/workaround for this at startup.
chown "$HOST_UID:$HOST_GID" /var/www
# We apply a fix/workaround for this at startup (non-recursive).
chown "${HOST_UID-:1000}:${HOST_GID:-1000}" /var/www

# Initialization steps completed. Create a pid file to mark the container as healthy
echo-debug "Preliminary initialization completed"
Expand Down
6 changes: 3 additions & 3 deletions 7.1/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ render_tmpl "$HOME_DIR/.acquia/cloudapi.conf"
# Make sure permissions are correct (after uid/gid change and COPY operations in Dockerfile)
# To not bloat the image size, permissions on the home folder are reset at runtime.
echo-debug "Resetting permissions on $HOME_DIR and /var/www..."
chown "$HOST_UID:$HOST_GID" -R "$HOME_DIR"
chown "${HOST_UID-:1000}:${HOST_GID:-1000}" -R "$HOME_DIR"
# Docker resets the project root folder permissions to 0:0 when cli is recreated (e.g. an env variable updated).
# We apply a fix/workaround for this at startup.
chown "$HOST_UID:$HOST_GID" /var/www
# We apply a fix/workaround for this at startup (non-recursive).
chown "${HOST_UID-:1000}:${HOST_GID:-1000}" /var/www

# Initialization steps completed. Create a pid file to mark the container as healthy
echo-debug "Preliminary initialization completed"
Expand Down
6 changes: 3 additions & 3 deletions 7.2/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ render_tmpl "$HOME_DIR/.acquia/cloudapi.conf"
# Make sure permissions are correct (after uid/gid change and COPY operations in Dockerfile)
# To not bloat the image size, permissions on the home folder are reset at runtime.
echo-debug "Resetting permissions on $HOME_DIR and /var/www..."
chown "$HOST_UID:$HOST_GID" -R "$HOME_DIR"
chown "${HOST_UID-:1000}:${HOST_GID:-1000}" -R "$HOME_DIR"
# Docker resets the project root folder permissions to 0:0 when cli is recreated (e.g. an env variable updated).
# We apply a fix/workaround for this at startup.
chown "$HOST_UID:$HOST_GID" /var/www
# We apply a fix/workaround for this at startup (non-recursive).
chown "${HOST_UID-:1000}:${HOST_GID:-1000}" /var/www

# Initialization steps completed. Create a pid file to mark the container as healthy
echo-debug "Preliminary initialization completed"
Expand Down

0 comments on commit 3f1e897

Please sign in to comment.