Add local etc skeleton files
This commit is contained in:
		
							
								
								
									
										18
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								Dockerfile
									
									
									
									
									
								
							| @@ -80,18 +80,12 @@ RUN curl -fL https://busybox.net/downloads/busybox-${BUSYB_VER}.tar.bz2 \ | ||||
|  | ||||
| WORKDIR $PREFIX | ||||
|  | ||||
| # Add default skeleton configuration files | ||||
| RUN for f in passwd shadow group profile; do \ | ||||
|         curl -fL -o "${PREFIX}/etc/$f" "https://git.busybox.net/buildroot/plain/system/skeleton/etc/$f"; \ | ||||
|     done && \ | ||||
|     \ | ||||
|     # Copy UTC localtime to output | ||||
|     cp /usr/share/zoneinfo/Etc/UTC etc/ | ||||
|  | ||||
| # Generate initial ld.so.cache so ELF binaries work. | ||||
| # This is important otherwise everything will error with | ||||
| # 'no such file or directory' when looking for libraries | ||||
| RUN ${PREFIX}/sbin/ldconfig -r ${PREFIX} | ||||
| RUN ${PREFIX}/sbin/ldconfig -r ${PREFIX} && \ | ||||
|     # Copy UTC localtime to output | ||||
|     cp /usr/share/zoneinfo/Etc/UTC etc/ | ||||
|  | ||||
| # ============= | ||||
|  | ||||
| @@ -99,9 +93,11 @@ FROM scratch | ||||
| WORKDIR / | ||||
|  | ||||
| COPY --from=builder /output/ / | ||||
| RUN mkdir -p /tmp && \ | ||||
|     chmod 1777 /tmp | ||||
| # Add default skeleton configuration files | ||||
| ADD skel/* /etc/ | ||||
| RUN chmod 1777 /tmp | ||||
|  | ||||
| ENV ENV="/etc/profile" | ||||
| ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/bin  | ||||
|  | ||||
| CMD ["/bin/sh"] | ||||
|   | ||||
							
								
								
									
										26
									
								
								skel/group
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								skel/group
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | ||||
| root:x:0: | ||||
| daemon:x:1: | ||||
| bin:x:2: | ||||
| sys:x:3: | ||||
| adm:x:4: | ||||
| tty:x:5: | ||||
| disk:x:6: | ||||
| lp:x:7: | ||||
| mail:x:8: | ||||
| kmem:x:9: | ||||
| wheel:x:10:root | ||||
| cdrom:x:11: | ||||
| dialout:x:18: | ||||
| floppy:x:19: | ||||
| video:x:28: | ||||
| audio:x:29: | ||||
| tape:x:32: | ||||
| www-data:x:33: | ||||
| operator:x:37: | ||||
| utmp:x:43: | ||||
| plugdev:x:46: | ||||
| staff:x:50: | ||||
| lock:x:54: | ||||
| netdev:x:82: | ||||
| users:x:100: | ||||
| nogroup:x:65534: | ||||
							
								
								
									
										9
									
								
								skel/passwd
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								skel/passwd
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| root:x:0:0:root:/root:/bin/sh | ||||
| daemon:x:1:1:daemon:/usr/sbin:/bin/false | ||||
| bin:x:2:2:bin:/bin:/bin/false | ||||
| sys:x:3:3:sys:/dev:/bin/false | ||||
| sync:x:4:100:sync:/bin:/bin/sync | ||||
| mail:x:8:8:mail:/var/spool/mail:/bin/false | ||||
| www-data:x:33:33:www-data:/var/www:/bin/false | ||||
| operator:x:37:37:Operator:/var:/bin/false | ||||
| nobody:x:65534:65534:nobody:/home:/bin/false | ||||
							
								
								
									
										20
									
								
								skel/profile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								skel/profile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| export PAGER='/bin/less -R' | ||||
| export EDITOR='/bin/vi' | ||||
| export PS1='\u@\h \w> ' | ||||
|  | ||||
| # Source configuration files from /etc/profile.d | ||||
| for i in /etc/profile.d/*.sh ; do | ||||
| 	if [ -r "$i" ]; then | ||||
| 		. $i | ||||
| 	fi | ||||
| 	unset i | ||||
| done | ||||
|  | ||||
| # Common interactive aliases | ||||
| alias ls='ls --color=auto -Fh' | ||||
| alias ll='ls -l' | ||||
| alias la='ls -la' | ||||
|  | ||||
| alias cp='cp -i' | ||||
| alias mv='mv -i' | ||||
| alias rm='rm -i' | ||||
							
								
								
									
										9
									
								
								skel/shadow
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								skel/shadow
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| root::10933:0:99999:7::: | ||||
| daemon:*:10933:0:99999:7::: | ||||
| bin:*:10933:0:99999:7::: | ||||
| sys:*:10933:0:99999:7::: | ||||
| sync:*:10933:0:99999:7::: | ||||
| mail:*:10933:0:99999:7::: | ||||
| www-data:*:10933:0:99999:7::: | ||||
| operator:*:10933:0:99999:7::: | ||||
| nobody:*:10933:0:99999:7::: | ||||
		Reference in New Issue
	
	Block a user