Skip to content
This repository has been archived by the owner on Apr 30, 2023. It is now read-only.

Upgrade to alpine 3.14 #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

mrmeyers99
Copy link
Contributor

@mrmeyers99 mrmeyers99 commented Nov 8, 2021

This is to enable alpine 3.14 (#41) again so that builds can use npm 7 formatted package files.

This is a super hacky fix, but I couldn't find a better way around this. For some reason when cdk runs it's running as the user 1001 and group 121, but the "cdk.out" folder gets created as root, which cdk doesn't have permissions to write to. This pre-creates the cdk.out directory and changes the owner of it to 1001 so that cdk can write to it.

I wasn't sure if 1001:121 was static or not, and I couldn't find a way to get it from github, so this figures out the user and group id from the node_modules folder and creates a user and group with those ids.

The other thing I want to try is having Docker run as a different user besides root, but thought I'd share this hacky solution in the meantime.

@mrmeyers99
Copy link
Contributor Author

I'm not convinced this isn't the better way. Trying to get this action to run under a user instead of under root also had a lot of problems. Maybe it would be better to download the aws cli directly instead of through CDK like this other action does? Not sure if that would help.

@mrmeyers99 mrmeyers99 marked this pull request as ready for review November 8, 2021 22:17
@mrmeyers99
Copy link
Contributor Author

mrmeyers99 commented Nov 17, 2021

I've created another branch as an alternative if you like that solution better. Not sure which one is better honestly. That branch runs docker under a user called github instead of as root.

master...mrmeyers99:alpine-3.14-better

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant