Docker: add new user in Alpine Linux

If you want to create a new user within a Dockerfile for an Alpine Linux, useradd won’t work. You have to use adduser.
This command will work
adduser -h /home/userx -g groupx -S userx

Please mind to add the -S (uppercase!!). If you omit this, Alpine ask interactively for a password. Interestingly, the option --disabled-password does not work!?!?

Untar to a specific target directory

tar xvf /opt/metricbeat.tar.gz -C /opt/metricbeat --strip-components=1
If the tar-file already contains a directory, you have to add –strip-components=1. Otherwise the directory contained in the tar files is created. Also mind that the directory used for -C has to exist beforehand.