Skip to content

Commit 8fb5439

Browse files
committed
wip
1 parent 476bbad commit 8fb5439

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

dockerfiles/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Testimages
2+
3+
*TODO*: automatically create multiarch images for:
4+
5+
- Linux
6+
- Windows
7+
8+
A container's base image OS must match the host's OS: https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility?tabs=windows-server-1909%2Cwindows-10-1909
9+
10+
Otherwise we'll get error messages like this when trying to run an image with the wrong base image OS:
11+
12+
> The container operating system does not match the host operating system
13+
14+
See https://github.com/olljanat/multi-win-version-aspnet for an example of creating Windows multiarch images (source: https://github.com/moby/moby/issues/35247#issuecomment-436634221).

dockerfiles/socat/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM alpine:edge
2+
3+
# usage:
4+
# - build: docker build -t socat .
5+
# - run w/ explicit port mapping: docker run --rm -it -p 2375:2375 -v /var/run/docker.sock:/var/run/docker.sock socat
6+
# - run w/ dynamic port mapping: docker run --rm -it -P -v /var/run/docker.sock:/var/run/docker.sock socat
7+
8+
# enable debug mode to watch the traffic:
9+
# https://blog.mikesir87.io/2018/10/using-socat-to-see-docker-socket-traffic/
10+
#
11+
# tl;dr
12+
# socat -d -v -d TCP-L:2375,fork UNIX:/var/run/docker.sock
13+
# export DOCKER_HOST=localhost:2375
14+
#
15+
# any Docker commands
16+
# docker container run --rm -dp 80:80 nginx
17+
18+
EXPOSE 2375
19+
RUN apk add -U socat
20+
ENTRYPOINT [ "socat" ]
21+
CMD [ "TCP-LISTEN:2375,reuseaddr,fork", "UNIX-CLIENT:/var/run/docker.sock" ]

0 commit comments

Comments
 (0)