<p></p>
<p>osmtools/builder is available on docker hub. But I do not recommend to use it. This was just for "inspiration", so you get an idea on how I build it. It is an image I use to build multiple osm tools in a similar fashion than osm2pgsql. A docker built environment for osm2pgsql should stack on top of some maintained base image. Either alpine or debian/ubuntu, like you did.</p>
<p>The second section of the Dockerfile shows how to use files from the earlier stage. I only extract the binary.</p>
<p>I don't think that MinSizeRel will trigger any static linkage, but I have not checked. I also do not run the binary from within the "FROM scratch" container. That one is very empty and just holds the versioned artifact.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/osm2pgsql/pull/1427#issuecomment-797689526">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353T7TVLEVGRWWZX7OETTDJQUBANCNFSM4ZB2J25A">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AA6353XBN5DBX6INWSW43QLTDJQUBA5CNFSM4ZB2J25KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF6F4NNQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/osm2pgsql/pull/1427#issuecomment-797689526",
"url": "https://github.com/openstreetmap/osm2pgsql/pull/1427#issuecomment-797689526",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>