Skip to content

Instantly share code, notes, and snippets.

@micahyoung
micahyoung / NOTES.md
Last active May 13, 2020 18:53
Notes about windows directory symlinks

Summary

Docker (and other tools) appear to not properly convert directory symlinks on either docker build+COPY . . or docker cp to a running container

Tests

git clone, by default, for file symlinks it copies the data to both source and target files and for directory symlinks it creates empty files instead of a directory

git clone -c core.symlinks=true recreates file and directory symlinks correctly but is not the default

tar.exe creates tar but when extracted, the symlink is an empty file (same for ustar, pax formats)

@micahyoung
micahyoung / Dockerfile
Created May 12, 2020 12:27
Get Docker Daemon Windows Host OS Version
ARG os_tag
FROM mcr.microsoft.com/windows/servercore:${os_tag}
...

Issue for mutate.Rebase with foreign layers

@micahyoung
micahyoung / Dockerfile
Created February 18, 2020 19:23
Debugging Windows 10 Docker not exposing ports
FROM golang:1.13-nanoserver-1809
COPY main.go c:/main.go
RUN go build -o c:\\webserver.exe c:\\main.go
CMD ["c:\\webserver.exe"]
hexdump -n 5 -e '4/4 "%x" 1 "\n"' /dev/random
@micahyoung
micahyoung / grep-export.sh
Created November 13, 2019 14:19
Generate export commands for specific keys
env | grep 'BOSH.*=' | cut -d'=' -f1 | while read key; do eval "val=\"\$$key\""; echo "export $key=\"$val\""; done
@micahyoung
micahyoung / INSTRUCTIONS.md
Last active October 29, 2019 00:52
Patch offline image to match current

Get current OS image and buid number

systeminfo
#> OS Name:     Microsoft Windows Server 2019 Datacenter
#> OS Version:  10.0.17763 N/A Build 17763

Make patched source from older iso

  1. Get an ISO with same version but lower patch than current image
#!/bin/bash
set -o errexit -o pipefail -o nounset
bosh repack-stemcell --empty-image \
--cloud-properties="$(bosh interpolate --path /Tables/0/Rows/0 <(bosh inspect-local-stemcell --json $1))" \
$1 \
$(dirname $1)/light-$(basename $1)
@micahyoung
micahyoung / INSTALL_FUSION_DOCKER_FOR_WINDOWS.md
Last active April 21, 2020 11:51
Windows Docker Daemon VM