[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1005906: Strace / Docker build output



--- Dockerfile ---

FROM rocker/r-base:4.1.2

RUN echo "cachebust"

COPY ./test_executable.sh /usr/local/bin
RUN test_executable.sh

RUN apt-get update && apt-get install -y strace nano

RUN test_executable.sh

--- Dockerfile ---

--- test_executable.sh ---
#!/bin/sh
if test -x /usr/bin/head; then echo "/usr/bin/head is executable"; else echo "dead beef"; fi
--- end test_executable.sh ---

--- output from `docker build` ---
Sending build context to Docker daemon  3.072kB
Step 1/6 : FROM rocker/r-base:4.1.2
 ---> 91af7f4c94cd
Step 2/6 : RUN echo "cachebust"
 ---> Running in a03d2ef2988f
cachebust
Removing intermediate container a03d2ef2988f
 ---> a940509c1f09
Step 3/6 : COPY ./test_executable.sh /usr/local/bin
 ---> 40e0033678f6
Step 4/6 : RUN test_executable.sh
 ---> Running in 443f48de4a9a
/usr/bin/head is executable
Removing intermediate container 443f48de4a9a
 ---> 7c788c3ecd0e
Step 5/6 : RUN apt-get update && apt-get install -y strace nano
 ---> Running in 20409d48b35c
Ign:1 https://eddelbuettel.github.io/ppaR400 ./ InRelease
Get:2 https://eddelbuettel.github.io/ppaR400 ./ Release [1,204 B]
Ign:3 https://eddelbuettel.github.io/ppaR400 ./ Release.gpg
Get:4 http://deb.debian.org/debian testing InRelease [129 kB]
Get:5 http://deb.debian.org/debian experimental InRelease [75.4 kB]
Get:6 https://eddelbuettel.github.io/ppaR400 ./ Packages [26.4 kB]
Get:8 http://deb.debian.org/debian testing/main amd64 Packages [8,310 kB]
Get:7 http://cdn-fastly.deb.debian.org/debian sid InRelease [165 kB]
Get:9 http://cdn-fastly.deb.debian.org/debian sid/main amd64 Packages [8,979 kB] Get:10 http://deb.debian.org/debian experimental/main amd64 Packages [385 kB]
Fetched 18.1 MB in 8s (2,307 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  libc-bin libc-dev-bin libc-l10n libc6 libc6-dev libunwind8 locales
Suggested packages:
  glibc-doc libnss-nis libnss-nisplus manpages-dev hunspell
Recommended packages:
  manpages manpages-dev libc-devtools
The following NEW packages will be installed:
  libunwind8 nano strace
The following packages will be upgraded:
  libc-bin libc-dev-bin libc-l10n libc6 libc6-dev locales
6 upgraded, 3 newly installed, 0 to remove and 169 not upgraded.
Need to get 13.0 MB of archives.
After this operation, 7,139 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian testing/main amd64 libc-l10n all 2.33-5 [864 kB] Get:2 http://deb.debian.org/debian testing/main amd64 libc-dev-bin amd64 2.33-5 [243 kB] Get:3 http://deb.debian.org/debian testing/main amd64 libc6-dev amd64 2.33-5 [2,274 kB] Get:4 http://deb.debian.org/debian testing/main amd64 locales all 2.33-5 [4,088 kB] Get:5 http://deb.debian.org/debian testing/main amd64 libc6 amd64 2.33-5 [2,831 kB] Get:6 http://deb.debian.org/debian testing/main amd64 libc-bin amd64 2.33-5 [834 kB] Get:7 http://deb.debian.org/debian testing/main amd64 nano amd64 6.1-1 [707 kB] Get:8 http://deb.debian.org/debian testing/main amd64 libunwind8 amd64 1.3.2-2 [54.5 kB] Get:9 http://deb.debian.org/debian testing/main amd64 strace amd64 5.10-1 [1,084 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 13.0 MB in 4s (2,988 kB/s)
(Reading database ... 18127 files and directories currently installed.)
Preparing to unpack .../libc-l10n_2.33-5_all.deb ...
Unpacking libc-l10n (2.33-5) over (2.32-4) ...
Preparing to unpack .../libc-dev-bin_2.33-5_amd64.deb ...
Unpacking libc-dev-bin (2.33-5) over (2.32-4) ...
Preparing to unpack .../libc6-dev_2.33-5_amd64.deb ...
Unpacking libc6-dev:amd64 (2.33-5) over (2.32-4) ...
Preparing to unpack .../locales_2.33-5_all.deb ...
Unpacking locales (2.33-5) over (2.32-4) ...
Preparing to unpack .../libc6_2.33-5_amd64.deb ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
Checking for services that may need to be restarted...
Checking init scripts...
Unpacking libc6:amd64 (2.33-5) over (2.32-4) ...
Setting up libc6:amd64 (2.33-5) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
(Reading database ... 18133 files and directories currently installed.)
Preparing to unpack .../libc-bin_2.33-5_amd64.deb ...
Unpacking libc-bin (2.33-5) over (2.32-4) ...
Setting up libc-bin (2.33-5) ...
Selecting previously unselected package nano.
(Reading database ... 18133 files and directories currently installed.)
Preparing to unpack .../archives/nano_6.1-1_amd64.deb ...
Unpacking nano (6.1-1) ...
Selecting previously unselected package libunwind8:amd64.
Preparing to unpack .../libunwind8_1.3.2-2_amd64.deb ...
Unpacking libunwind8:amd64 (1.3.2-2) ...
Selecting previously unselected package strace.
Preparing to unpack .../strace_5.10-1_amd64.deb ...
Unpacking strace (5.10-1) ...
Setting up libc-l10n (2.33-5) ...
Setting up locales (2.33-5) ...
Installing new version of config file /etc/locale.alias ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
Generating locales (this might take a while)...
  en_US.UTF-8... done
Generation complete.
Setting up libunwind8:amd64 (1.3.2-2) ...
Setting up strace (5.10-1) ...
Setting up nano (6.1-1) ...
update-alternatives: using /bin/nano to provide /usr/bin/editor (editor) in auto mode update-alternatives: using /bin/nano to provide /usr/bin/pico (pico) in auto mode
Setting up libc-dev-bin (2.33-5) ...
Setting up libc6-dev:amd64 (2.33-5) ...
Processing triggers for libc-bin (2.33-5) ...
Removing intermediate container 20409d48b35c
 ---> 1f65872f7aef
Step 6/6 : RUN test_executable.sh
 ---> Running in 9ec3db9ab4b4
dead beef
Removing intermediate container 9ec3db9ab4b4
 ---> 38b670c82d87
Successfully built 38b670c82d87
Successfully tagged declare_test:2022-02-18
Successfully tagged declare_test:latest
--- end `docker build` output ---

--- output from `docker run --cap-add SYS_PTRACE -ti declare_test strace test_executable.sh`---

Execve("/usr/local/bin/test_executable.sh", ["test_executable.sh"], 0x7fffe1989b90 /* 7 vars */) = 0
brk(NULL)                               = 0x562a3655e000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=15011, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 15011, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f0a30107000
close(3)                                = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000y\2\0\0\0\0\0"..., 832) = 832 pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784 pread64(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\200\0\300\4\0\0\0\1\0\0\0\0\0\0\0", 32, 848) = 32 pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0007\365/\272`\30\360\245\204\243\5\207\253\306\35("..., 68, 880) = 68 newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=1835120, ...}, AT_EMPTY_PATH) = 0 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0a30105000 pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784 mmap(NULL, 1864568, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f0a2ff3d000 mmap(0x7f0a2ff63000, 1343488, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x26000) = 0x7f0a2ff63000 mmap(0x7f0a300ab000, 307200, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16e000) = 0x7f0a300ab000 mmap(0x7f0a300f6000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b9000) = 0x7f0a300f6000 mmap(0x7f0a300fc000, 33656, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f0a300fc000
close(3)                                = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0a2ff3b000
arch_prctl(ARCH_SET_FS, 0x7f0a30106600) = 0
mprotect(0x7f0a300f6000, 12288, PROT_READ) = 0
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
mprotect(0x562a3491c000, 8192, PROT_READ) = 0
mprotect(0x7f0a3013a000, 8192, PROT_READ) = 0
munmap(0x7f0a30107000, 15011)           = 0
getuid()                                = 0
getgid()                                = 0
getpid()                                = 8
rt_sigaction(SIGCHLD, {sa_handler=0x562a34911a20, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f0a2ff79910}, NULL, 8) = 0
geteuid()                               = 0
brk(NULL)                               = 0x562a3655e000
brk(0x562a3657f000)                     = 0x562a3657f000
getppid()                               = 1
getcwd("/", 4096)                       = 2
openat(AT_FDCWD, "/usr/local/bin/test_executable.sh", O_RDONLY) = 3
fcntl(3, F_DUPFD, 10)                   = 10
close(3)                                = 0
fcntl(10, F_SETFD, FD_CLOEXEC)          = 0
geteuid()                               = 0
getegid()                               = 0
rt_sigaction(SIGINT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGINT, {sa_handler=0x562a34911a20, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f0a2ff79910}, NULL, 8) = 0 rt_sigaction(SIGQUIT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGQUIT, {sa_handler=SIG_DFL, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f0a2ff79910}, NULL, 8) = 0 rt_sigaction(SIGTERM, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGTERM, {sa_handler=SIG_DFL, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f0a2ff79910}, NULL, 8) = 0
read(10, "#!/bin/sh\nif test -x /usr/bin/he"..., 8192) = 103
syscall_0xffffffffffffffff(0xffffff9c, 0x562a3655e490, 0x1, 0x200, 0x562a3655e4b0, 0x7f0a300f9c00) = -1 EPERM (Operation not permitted)
write(1, "dead beef\n", 10dead beef
)             = 10
read(10, "", 8192)                      = 0
exit_group(0)                           = ?
+++ exited with 0 +++

--- end output from `docker run --cap-add SYS_PTRACE -ti declare_test strace test_executable.sh` ---


Reply to: