bug-wget
[Top][All Lists]
Advanced

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

Building wget2 2.1.0 using docker.


From: Michael D. Setzer II
Subject: Building wget2 2.1.0 using docker.
Date: Fri, 27 Oct 2023 05:36:00 +1000

Had gotten instructions, but had never used docker before and 
something happened different on my Fedora 38 system.

But does seem to work fine.
Process creates a 24993339 wget2.exe
stripping it gets size down 4537344 wget2.exe
and using upx further lowers to 2386432 wget2.exe 

Not familiar with docker, so this is steps I was able to use.
Have down it 3 times and tried to document it. Seems to require 
multiple terminal windows and had to search for where the 
wget2.exe file was actual created and had to copy it since closing 
it removes most files? Original instructions said it should have 
been left in /tmp directory, but no files there. Might be how Fedora 
does docker??

Note: some lines wrap here.
Seems to work with up to 10 threads.

#!/bin/bash
# Make sure docker not running?
# Make sure build-images directory doesn't exist?
ps -ef | grep docker
dockerd
ps -ef | grep docker
#root      267124  267044  0 04:17 pts/0    00:00:00 dockerd
#root      267136  267124  0 04:17 ?        00:00:00 containerd --config 
/var/run/docker/containerd/containerd.toml

In 2nd Terminal Window run
#!/bin/bash
git clone https://gitlab.com/gnuwget/build-images.git
cd build-images
docker build -f docker-debian-mingw-static/Dockerfile .
# The number after /tmp is at end and needs to be modified to match
docker run -it --rm -v /tmp:/tmp 078cc54eeb0c

Then get prompt
root@c23396768b3c:/usr/local#

#Copy Paste following commands
git clone https://gitlab.com/gnuwget/wget2.git
cd wget2
./bootstrap --skip-po
(Note: Bold is one long line)
LDFLAGS="-Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive" 
CFLAGS="-O2 -DNGHTTP2_STATICLIB" ./configure $CONFIGURE_BASE_FLAGS 
--build=x86_64-pc-linux-gnu --host=$PREFIX --disable-shared --enable-static 
--without-gpgme --enable-threads=windows 
make -j$(nproc)

=====
ps -ef | grep docker
root      267124  267044  0 04:17 pts/0    00:00:00 dockerd
root      267136  267124  0 04:17 ?        00:00:01 containerd --config 
/var/run/docker/containerd/containerd.toml
root      268213  268193  0 04:28 pts/3    00:00:00 docker run -it --rm -v 
/tmp:/tmp 078cc54eeb0c
root      268247       1  0 04:28 ?        00:00:00 
/usr/bin/containerd-shim-runc-v2 -namespace moby -id 
c23396768b3c44765da887cd003886d1311ea8c19ef92314434a8b1fd1b06f82 -address 
/var/run/docker/containerd/containerd.sock

This is were I had to find results. Original instructions said the wget2.exe 
should be in /tmp directory, but search does not find it there?
pwd
/var/lib/docker/overlay2/fcd51ecbe16d3c04952688eccba83bb2b42208dff35941afbf5484b4b
4784860
find . | grep wget2.exe
./merged/usr/local/wget2/src/wget2.exe
./diff/usr/local/wget2/src/wget2.exe

Files are same so copy to /root
pwd
/var/lib/docker/overlay2/fcd51ecbe16d3c04952688eccba83bb2b42208dff35941afbf5484b4b
4784860/diff/usr/local/wget2/src
ls -lrt wget2*.exe
-rwxr-xr-x. 1 root root 24993339 Oct 27 04:37 wget2.exe
-rwxr-xr-x. 1 root root 24993851 Oct 27 04:37 wget2_noinstall.exe
cp wget2.exe /root

In terminal windows with
root@c23396768b3c:/usr/local/wget2#
type exit

At this point the directory structure where wget2.exe (fcd... no longer exists?)
These files still exist.
pwd
/var/lib/docker/overlay2
[root@setzco103 overlay2]# find . | grep wget2
./f298cc85f01aa7ee6b8b97809dd3296d412f2f9110d43d715a3f122ec14b9021/diff/home/tim/s
rc/wget2
./f298cc85f01aa7ee6b8b97809dd3296d412f2f9110d43d715a3f122ec14b9021/diff/home/tim/s
rc/wget2/x86_64-w64-mingw32
./f298cc85f01aa7ee6b8b97809dd3296d412f2f9110d43d715a3f122ec14b9021/diff/home/tim/s
rc/wget2/x86_64-w64-mingw32/include
./f298cc85f01aa7ee6b8b97809dd3296d412f2f9110d43d715a3f122ec14b9021/diff/home/tim/s
rc/wget2/x86_64-w64-mingw32/include/brotli
./f298cc85f01aa7ee6b8b97809dd3296d412f2f9110d43d715a3f122ec14b9021/diff/home/tim/s
rc/wget2/x86_64-w64-mingw32/include/brotli/decode.h
./f298cc85f01aa7ee6b8b97809dd3296d412f2f9110d43d715a3f122ec14b9021/diff/home/tim/s
rc/wget2/x86_64-w64-mingw32/include/brotli/types.h
./f298cc85f01aa7ee6b8b97809dd3296d412f2f9110d43d715a3f122ec14b9021/diff/home/tim/s
rc/wget2/x86_64-w64-mingw32/include/brotli/encode.h
./f298cc85f01aa7ee6b8b97809dd3296d412f2f9110d43d715a3f122ec14b9021/diff/home/tim/s
rc/wget2/x86_64-w64-mingw32/include/brotli/port.h
./f298cc85f01aa7ee6b8b97809dd3296d412f2f9110d43d715a3f122ec14b9021/diff/home/tim/s
rc/wget2/x86_64-w64-mingw32/include/brotli/shared_dictionary.h
./f298cc85f01aa7ee6b8b97809dd3296d412f2f9110d43d715a3f122ec14b9021/diff/home/tim/s
rc/wget2/x86_64-w64-mingw32/lib
./f298cc85f01aa7ee6b8b97809dd3296d412f2f9110d43d715a3f122ec14b9021/diff/home/tim/s
rc/wget2/x86_64-w64-mingw32/lib/pkgconfig
./f298cc85f01aa7ee6b8b97809dd3296d412f2f9110d43d715a3f122ec14b9021/diff/home/tim/s
rc/wget2/x86_64-w64-mingw32/lib/pkgconfig/libbrotlienc.pc
./f298cc85f01aa7ee6b8b97809dd3296d412f2f9110d43d715a3f122ec14b9021/diff/home/tim/s
rc/wget2/x86_64-w64-mingw32/lib/pkgconfig/libbrotlidec.pc
./f298cc85f01aa7ee6b8b97809dd3296d412f2f9110d43d715a3f122ec14b9021/diff/home/tim/s
rc/wget2/x86_64-w64-mingw32/lib/pkgconfig/libbrotlicommon.pc
./f298cc85f01aa7ee6b8b97809dd3296d412f2f9110d43d715a3f122ec14b9021/diff/home/tim/s
rc/wget2/x86_64-w64-mingw32/lib/libbrotlicommon.a
./f298cc85f01aa7ee6b8b97809dd3296d412f2f9110d43d715a3f122ec14b9021/diff/home/tim/s
rc/wget2/x86_64-w64-mingw32/lib/libbrotlienc.a
./f298cc85f01aa7ee6b8b97809dd3296d412f2f9110d43d715a3f122ec14b9021/diff/home/tim/s
rc/wget2/x86_64-w64-mingw32/lib/libbrotlidec.a
./f298cc85f01aa7ee6b8b97809dd3296d412f2f9110d43d715a3f122ec14b9021/diff/home/tim/s
rc/wget2/x86_64-w64-mingw32/bin
./f298cc85f01aa7ee6b8b97809dd3296d412f2f9110d43d715a3f122ec14b9021/diff/home/tim/s
rc/wget2/x86_64-w64-mingw32/bin/brotli

But had copied wget2.exe earlier to /root so have copy.
killall dockerd 
since no longer needed?
Files in root created by process
24993339 Oct 27 04:44  wget2.exe
strip wget2.exe 
# ls -l wget2.exe 
 4537344 Oct 27 04:58 wget2.exe
upx wget2.exe 
                       Ultimate Packer for eXecutables
                          Copyright (C) 1996 - 2023
UPX 4.1.0       Markus Oberhumer, Laszlo Molnar & John Reiser    Aug 8th 2023

        File size         Ratio      Format      Name
   --------------------   ------   -----------   -----------
   4537344 ->   2386432   52.60%    win64/pe     wget2.exe                     

Packed 1 file.
# ls -l wget2.exe 
 2386432 Oct 27 04:58 wget2.exe




+------------------------------------------------------------+
 Michael D. Setzer II - Computer Science Instructor (Retired)     
 mailto:mikes@guam.net                            
 mailto:msetzerii@gmail.com
 Guam - Where America's Day Begins                        
 G4L Disk Imaging Project maintainer 
 http://sourceforge.net/projects/g4l/
+------------------------------------------------------------+




reply via email to

[Prev in Thread] Current Thread [Next in Thread]