Skip to content

Instantly share code, notes, and snippets.

@AndrewGMorgan
Created April 12, 2022 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewGMorgan/84e8db2dd47f51f45e6f1529c3a8a5fb to your computer and use it in GitHub Desktop.
Save AndrewGMorgan/84e8db2dd47f51f45e6f1529c3a8a5fb to your computer and use it in GitHub Desktop.
$ docker build -f Dockerfile .
Sending build context to Docker daemon 23.55kB
Step 1/7 : FROM buildpack-deps:bullseye-scm
---> 24d8bfbc3d97
Step 2/7 : RUN apt update && apt install -y --no-install-recommends g++ gcc libc6-dev make wget && ldd --version
---> Running in 75da9ea78547
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:2 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB]
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [39.4 kB]
Get:4 http://security.debian.org/debian-security bullseye-security/main amd64 Packages [124 kB]
Get:5 http://deb.debian.org/debian bullseye/main amd64 Packages [8182 kB]
Get:6 http://deb.debian.org/debian bullseye-updates/main amd64 Packages [2596 B]
Fetched 8508 kB in 2s (3798 kB/s)
Reading package lists...
Building dependency tree...
Reading state information...
1 package can be upgraded. Run 'apt list --upgradable' to see it.
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Reading package lists...
Building dependency tree...
Reading state information...
wget is already the newest version (1.21-1+deb11u1).
The following additional packages will be installed:
binutils binutils-common binutils-x86-64-linux-gnu cpp cpp-10 g++-10 gcc-10
libasan6 libatomic1 libbinutils libc-dev-bin libcc1-0 libcrypt-dev
libctf-nobfd0 libctf0 libgcc-10-dev libgomp1 libisl23 libitm1 liblsan0
libmpc3 libmpfr6 libnsl-dev libquadmath0 libstdc++-10-dev libtirpc-dev
libtsan0 libubsan1 linux-libc-dev
Suggested packages:
binutils-doc cpp-doc gcc-10-locales g++-multilib g++-10-multilib gcc-10-doc
gcc-multilib manpages-dev autoconf automake libtool flex bison gdb gcc-doc
gcc-10-multilib glibc-doc libstdc++-10-doc make-doc
Recommended packages:
manpages manpages-dev libc-devtools
The following NEW packages will be installed:
binutils binutils-common binutils-x86-64-linux-gnu cpp cpp-10 g++ g++-10 gcc
gcc-10 libasan6 libatomic1 libbinutils libc-dev-bin libc6-dev libcc1-0
libcrypt-dev libctf-nobfd0 libctf0 libgcc-10-dev libgomp1 libisl23 libitm1
liblsan0 libmpc3 libmpfr6 libnsl-dev libquadmath0 libstdc++-10-dev
libtirpc-dev libtsan0 libubsan1 linux-libc-dev make
0 upgraded, 33 newly installed, 0 to remove and 1 not upgraded.
Need to get 57.4 MB of archives.
After this operation, 221 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main amd64 binutils-common amd64 2.35.2-2 [2220 kB]
Get:2 http://deb.debian.org/debian bullseye/main amd64 libbinutils amd64 2.35.2-2 [570 kB]
Get:3 http://deb.debian.org/debian bullseye/main amd64 libctf-nobfd0 amd64 2.35.2-2 [110 kB]
Get:4 http://deb.debian.org/debian bullseye/main amd64 libctf0 amd64 2.35.2-2 [53.2 kB]
Get:5 http://deb.debian.org/debian bullseye/main amd64 binutils-x86-64-linux-gnu amd64 2.35.2-2 [1809 kB]
Get:6 http://deb.debian.org/debian bullseye/main amd64 binutils amd64 2.35.2-2 [61.2 kB]
Get:7 http://deb.debian.org/debian bullseye/main amd64 libisl23 amd64 0.23-1 [676 kB]
Get:8 http://deb.debian.org/debian bullseye/main amd64 libmpfr6 amd64 4.1.0-3 [2012 kB]
Get:9 http://deb.debian.org/debian bullseye/main amd64 libmpc3 amd64 1.2.0-1 [45.0 kB]
Get:10 http://deb.debian.org/debian bullseye/main amd64 cpp-10 amd64 10.2.1-6 [8528 kB]
Get:11 http://deb.debian.org/debian bullseye/main amd64 cpp amd64 4:10.2.1-1 [19.7 kB]
Get:12 http://deb.debian.org/debian bullseye/main amd64 libcc1-0 amd64 10.2.1-6 [47.0 kB]
Get:13 http://deb.debian.org/debian bullseye/main amd64 libgomp1 amd64 10.2.1-6 [99.9 kB]
Get:14 http://deb.debian.org/debian bullseye/main amd64 libitm1 amd64 10.2.1-6 [25.8 kB]
Get:15 http://deb.debian.org/debian bullseye/main amd64 libatomic1 amd64 10.2.1-6 [9008 B]
Get:16 http://deb.debian.org/debian bullseye/main amd64 libasan6 amd64 10.2.1-6 [2065 kB]
Get:17 http://deb.debian.org/debian bullseye/main amd64 liblsan0 amd64 10.2.1-6 [828 kB]
Get:18 http://deb.debian.org/debian bullseye/main amd64 libtsan0 amd64 10.2.1-6 [2000 kB]
Get:19 http://deb.debian.org/debian bullseye/main amd64 libubsan1 amd64 10.2.1-6 [777 kB]
Get:20 http://deb.debian.org/debian bullseye/main amd64 libquadmath0 amd64 10.2.1-6 [145 kB]
Get:21 http://deb.debian.org/debian bullseye/main amd64 libgcc-10-dev amd64 10.2.1-6 [2328 kB]
Get:22 http://deb.debian.org/debian bullseye/main amd64 gcc-10 amd64 10.2.1-6 [17.0 MB]
Get:23 http://deb.debian.org/debian bullseye/main amd64 gcc amd64 4:10.2.1-1 [5192 B]
Get:24 http://deb.debian.org/debian bullseye/main amd64 libc-dev-bin amd64 2.31-13+deb11u3 [275 kB]
Get:25 http://deb.debian.org/debian bullseye/main amd64 linux-libc-dev amd64 5.10.106-1 [1470 kB]
Get:26 http://deb.debian.org/debian bullseye/main amd64 libcrypt-dev amd64 1:4.4.18-4 [104 kB]
Get:27 http://deb.debian.org/debian bullseye/main amd64 libtirpc-dev amd64 1.3.1-1 [190 kB]
Get:28 http://deb.debian.org/debian bullseye/main amd64 libnsl-dev amd64 1.3.0-2 [66.4 kB]
Get:29 http://deb.debian.org/debian bullseye/main amd64 libc6-dev amd64 2.31-13+deb11u3 [2348 kB]
Get:30 http://deb.debian.org/debian bullseye/main amd64 libstdc++-10-dev amd64 10.2.1-6 [1741 kB]
Get:31 http://deb.debian.org/debian bullseye/main amd64 g++-10 amd64 10.2.1-6 [9380 kB]
Get:32 http://deb.debian.org/debian bullseye/main amd64 g++ amd64 4:10.2.1-1 [1644 B]
Get:33 http://deb.debian.org/debian bullseye/main amd64 make amd64 4.3-4.1 [396 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 57.4 MB in 3s (17.9 MB/s)
Selecting previously unselected package binutils-common:amd64.
(Reading database ... 12311 files and directories currently installed.)
Preparing to unpack .../00-binutils-common_2.35.2-2_amd64.deb ...
Unpacking binutils-common:amd64 (2.35.2-2) ...
Selecting previously unselected package libbinutils:amd64.
Preparing to unpack .../01-libbinutils_2.35.2-2_amd64.deb ...
Unpacking libbinutils:amd64 (2.35.2-2) ...
Selecting previously unselected package libctf-nobfd0:amd64.
Preparing to unpack .../02-libctf-nobfd0_2.35.2-2_amd64.deb ...
Unpacking libctf-nobfd0:amd64 (2.35.2-2) ...
Selecting previously unselected package libctf0:amd64.
Preparing to unpack .../03-libctf0_2.35.2-2_amd64.deb ...
Unpacking libctf0:amd64 (2.35.2-2) ...
Selecting previously unselected package binutils-x86-64-linux-gnu.
Preparing to unpack .../04-binutils-x86-64-linux-gnu_2.35.2-2_amd64.deb ...
Unpacking binutils-x86-64-linux-gnu (2.35.2-2) ...
Selecting previously unselected package binutils.
Preparing to unpack .../05-binutils_2.35.2-2_amd64.deb ...
Unpacking binutils (2.35.2-2) ...
Selecting previously unselected package libisl23:amd64.
Preparing to unpack .../06-libisl23_0.23-1_amd64.deb ...
Unpacking libisl23:amd64 (0.23-1) ...
Selecting previously unselected package libmpfr6:amd64.
Preparing to unpack .../07-libmpfr6_4.1.0-3_amd64.deb ...
Unpacking libmpfr6:amd64 (4.1.0-3) ...
Selecting previously unselected package libmpc3:amd64.
Preparing to unpack .../08-libmpc3_1.2.0-1_amd64.deb ...
Unpacking libmpc3:amd64 (1.2.0-1) ...
Selecting previously unselected package cpp-10.
Preparing to unpack .../09-cpp-10_10.2.1-6_amd64.deb ...
Unpacking cpp-10 (10.2.1-6) ...
Selecting previously unselected package cpp.
Preparing to unpack .../10-cpp_4%3a10.2.1-1_amd64.deb ...
Unpacking cpp (4:10.2.1-1) ...
Selecting previously unselected package libcc1-0:amd64.
Preparing to unpack .../11-libcc1-0_10.2.1-6_amd64.deb ...
Unpacking libcc1-0:amd64 (10.2.1-6) ...
Selecting previously unselected package libgomp1:amd64.
Preparing to unpack .../12-libgomp1_10.2.1-6_amd64.deb ...
Unpacking libgomp1:amd64 (10.2.1-6) ...
Selecting previously unselected package libitm1:amd64.
Preparing to unpack .../13-libitm1_10.2.1-6_amd64.deb ...
Unpacking libitm1:amd64 (10.2.1-6) ...
Selecting previously unselected package libatomic1:amd64.
Preparing to unpack .../14-libatomic1_10.2.1-6_amd64.deb ...
Unpacking libatomic1:amd64 (10.2.1-6) ...
Selecting previously unselected package libasan6:amd64.
Preparing to unpack .../15-libasan6_10.2.1-6_amd64.deb ...
Unpacking libasan6:amd64 (10.2.1-6) ...
Selecting previously unselected package liblsan0:amd64.
Preparing to unpack .../16-liblsan0_10.2.1-6_amd64.deb ...
Unpacking liblsan0:amd64 (10.2.1-6) ...
Selecting previously unselected package libtsan0:amd64.
Preparing to unpack .../17-libtsan0_10.2.1-6_amd64.deb ...
Unpacking libtsan0:amd64 (10.2.1-6) ...
Selecting previously unselected package libubsan1:amd64.
Preparing to unpack .../18-libubsan1_10.2.1-6_amd64.deb ...
Unpacking libubsan1:amd64 (10.2.1-6) ...
Selecting previously unselected package libquadmath0:amd64.
Preparing to unpack .../19-libquadmath0_10.2.1-6_amd64.deb ...
Unpacking libquadmath0:amd64 (10.2.1-6) ...
Selecting previously unselected package libgcc-10-dev:amd64.
Preparing to unpack .../20-libgcc-10-dev_10.2.1-6_amd64.deb ...
Unpacking libgcc-10-dev:amd64 (10.2.1-6) ...
Selecting previously unselected package gcc-10.
Preparing to unpack .../21-gcc-10_10.2.1-6_amd64.deb ...
Unpacking gcc-10 (10.2.1-6) ...
Selecting previously unselected package gcc.
Preparing to unpack .../22-gcc_4%3a10.2.1-1_amd64.deb ...
Unpacking gcc (4:10.2.1-1) ...
Selecting previously unselected package libc-dev-bin.
Preparing to unpack .../23-libc-dev-bin_2.31-13+deb11u3_amd64.deb ...
Unpacking libc-dev-bin (2.31-13+deb11u3) ...
Selecting previously unselected package linux-libc-dev:amd64.
Preparing to unpack .../24-linux-libc-dev_5.10.106-1_amd64.deb ...
Unpacking linux-libc-dev:amd64 (5.10.106-1) ...
Selecting previously unselected package libcrypt-dev:amd64.
Preparing to unpack .../25-libcrypt-dev_1%3a4.4.18-4_amd64.deb ...
Unpacking libcrypt-dev:amd64 (1:4.4.18-4) ...
Selecting previously unselected package libtirpc-dev:amd64.
Preparing to unpack .../26-libtirpc-dev_1.3.1-1_amd64.deb ...
Unpacking libtirpc-dev:amd64 (1.3.1-1) ...
Selecting previously unselected package libnsl-dev:amd64.
Preparing to unpack .../27-libnsl-dev_1.3.0-2_amd64.deb ...
Unpacking libnsl-dev:amd64 (1.3.0-2) ...
Selecting previously unselected package libc6-dev:amd64.
Preparing to unpack .../28-libc6-dev_2.31-13+deb11u3_amd64.deb ...
Unpacking libc6-dev:amd64 (2.31-13+deb11u3) ...
Selecting previously unselected package libstdc++-10-dev:amd64.
Preparing to unpack .../29-libstdc++-10-dev_10.2.1-6_amd64.deb ...
Unpacking libstdc++-10-dev:amd64 (10.2.1-6) ...
Selecting previously unselected package g++-10.
Preparing to unpack .../30-g++-10_10.2.1-6_amd64.deb ...
Unpacking g++-10 (10.2.1-6) ...
Selecting previously unselected package g++.
Preparing to unpack .../31-g++_4%3a10.2.1-1_amd64.deb ...
Unpacking g++ (4:10.2.1-1) ...
Selecting previously unselected package make.
Preparing to unpack .../32-make_4.3-4.1_amd64.deb ...
Unpacking make (4.3-4.1) ...
Setting up binutils-common:amd64 (2.35.2-2) ...
Setting up linux-libc-dev:amd64 (5.10.106-1) ...
Setting up libctf-nobfd0:amd64 (2.35.2-2) ...
Setting up libgomp1:amd64 (10.2.1-6) ...
Setting up libasan6:amd64 (10.2.1-6) ...
Setting up libtirpc-dev:amd64 (1.3.1-1) ...
Setting up make (4.3-4.1) ...
Setting up libmpfr6:amd64 (4.1.0-3) ...
Setting up libquadmath0:amd64 (10.2.1-6) ...
Setting up libmpc3:amd64 (1.2.0-1) ...
Setting up libatomic1:amd64 (10.2.1-6) ...
Setting up libubsan1:amd64 (10.2.1-6) ...
Setting up libnsl-dev:amd64 (1.3.0-2) ...
Setting up libcrypt-dev:amd64 (1:4.4.18-4) ...
Setting up libbinutils:amd64 (2.35.2-2) ...
Setting up libisl23:amd64 (0.23-1) ...
Setting up libc-dev-bin (2.31-13+deb11u3) ...
Setting up libcc1-0:amd64 (10.2.1-6) ...
Setting up liblsan0:amd64 (10.2.1-6) ...
Setting up cpp-10 (10.2.1-6) ...
Setting up libitm1:amd64 (10.2.1-6) ...
Setting up libtsan0:amd64 (10.2.1-6) ...
Setting up libctf0:amd64 (2.35.2-2) ...
Setting up libgcc-10-dev:amd64 (10.2.1-6) ...
Setting up cpp (4:10.2.1-1) ...
Setting up libc6-dev:amd64 (2.31-13+deb11u3) ...
Setting up binutils-x86-64-linux-gnu (2.35.2-2) ...
Setting up libstdc++-10-dev:amd64 (10.2.1-6) ...
Setting up binutils (2.35.2-2) ...
Setting up gcc-10 (10.2.1-6) ...
Setting up g++-10 (10.2.1-6) ...
Setting up gcc (4:10.2.1-1) ...
Setting up g++ (4:10.2.1-1) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
Processing triggers for libc-bin (2.31-13+deb11u3) ...
ldd (Debian GLIBC 2.31-13+deb11u3) 2.31
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
Removing intermediate container 75da9ea78547
---> 365cccc263e7
Step 3/7 : RUN v=1.18; t=go$v.linux-amd64.tar.gz; wget -q https://go.dev/dl/$t -O $t && tar -xf $t
---> Running in 3e4181400a0a
Removing intermediate container 3e4181400a0a
---> b97da5eef880
Step 4/7 : ADD foo.c .
---> e08d692d4819
Step 5/7 : RUN gcc -fPIC -c foo.c && gcc -shared -o foo.so -pthread foo.o
---> Running in 82026c9c482b
Removing intermediate container 82026c9c482b
---> c431c8557c0e
Step 6/7 : ADD . .
---> c25d91e4952d
Step 7/7 : RUN go/bin/go run .
---> Running in f09907a86bb3
# example
/usr/bin/ld: $WORK/b001/_x002.o: in function `_cgo_991924710996_Cfunc_dlopen':
/tmp/go-build/cgo-gcc-prolog:54: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
# example
/usr/bin/ld: /tmp/go-link-1267204903/000001.o: in function `_cgo_991924710996_Cfunc_dlopen':
/tmp/go-build/cgo-gcc-prolog:54: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
Step 1
Step 2
Step 3
Removing intermediate container f09907a86bb3
---> ef64a5a48d6a
Successfully built ef64a5a48d6a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment