Created
March 16, 2023 13:17
-
-
Save giovannicandido/f3ee6f1210896dbc29aeb352d42ab7d2 to your computer and use it in GitHub Desktop.
Dockerfile for rust project multiarch build
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM registry.access.redhat.com/ubi9/ubi-micro | |
ARG TARGETARCH | |
ARG EXECUTABLENAME | |
FROM registry.access.redhat.com/ubi9/ubi-micro | |
ARG TARGETARCH | |
ARG EXECUTABLENAME | |
COPY docker/passwd /etc/passwd | |
COPY docker/group /etc/group | |
RUN chmod 644 /etc/passwd && \ | |
chmod 644 /etc/group && \ | |
mkdir /home/app && \ | |
chown app.app /home/app | |
COPY target/binaries/${TARGETARCH}-$EXECUTABLENAME /home/app/$EXECUTABLENAME | |
RUN chown -R app.app /home/app && \ | |
chmod 755 /home/app/$EXECUTABLENAME | |
USER app | |
WORKDIR /home/app | |
CMD ["/home/app/${EXECUTABLENAME}"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root:x:0: | |
bin:x:1: | |
daemon:x:2: | |
sys:x:3: | |
adm:x:4: | |
tty:x:5: | |
disk:x:6: | |
lp:x:7: | |
mem:x:8: | |
kmem:x:9: | |
wheel:x:10: | |
cdrom:x:11: | |
mail:x:12: | |
man:x:15: | |
dialout:x:18: | |
floppy:x:19: | |
games:x:20: | |
tape:x:33: | |
video:x:39: | |
ftp:x:50: | |
lock:x:54: | |
audio:x:63: | |
users:x:100: | |
nobody:x:65534: | |
utmp:x:22: | |
utempter:x:35: | |
input:x:999: | |
kvm:x:36: | |
render:x:998: | |
systemd-journal:x:190: | |
systemd-coredump:x:997: | |
dbus:x:81: | |
tss:x:59: | |
sgx:x:996: | |
systemd-oom:x:995: | |
app:x:1000: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root:x:0:0:root:/root:/bin/bash | |
bin:x:1:1:bin:/bin:/sbin/nologin | |
daemon:x:2:2:daemon:/sbin:/sbin/nologin | |
adm:x:3:4:adm:/var/adm:/sbin/nologin | |
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin | |
sync:x:5:0:sync:/sbin:/bin/sync | |
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown | |
halt:x:7:0:halt:/sbin:/sbin/halt | |
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin | |
operator:x:11:0:operator:/root:/sbin/nologin | |
games:x:12:100:games:/usr/games:/sbin/nologin | |
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin | |
nobody:x:65534:65534:Kernel Overflow User:/:/sbin/nologin | |
systemd-coredump:x:999:997:systemd Core Dumper:/:/sbin/nologin | |
dbus:x:81:81:System message bus:/:/sbin/nologin | |
tss:x:59:59:Account used for TPM access:/dev/null:/sbin/nologin | |
systemd-oom:x:995:995:systemd Userspace OOM Killer:/:/usr/sbin/nologin | |
app:x:1000:1000::/home/app:/bin/bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment