-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (26 loc) · 921 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM alpine:3.17.1
LABEL org.opencontainers.image.source=https://github.com/rgschmitz1/docker-to-ghcr
LABEL org.opencontainers.image.licenses=MIT
ARG ARCH
# install dependencies
RUN apk add --no-cache \
bash \
ca-certificates \
curl \
docker-cli \
gnupg \
jq \
pass
# get the latest version of docker-credential-pass
RUN repo='docker/docker-credential-helpers' \
&& ver=$(curl -sL https://api.github.com/repos/${repo}/releases/latest | jq -r '.tag_name') \
&& curl -sS \
https://github.com/${repo}/releases/download/${ver}/docker-credential-pass-${ver}.linux-$ARCH \
-o /usr/local/bin/docker-credential-pass \
&& chmod +x /usr/local/bin/docker-credential-pass \
&& mkdir -p $HOME/.docker \
&& jq -n '{"credsStore": "pass"}' > ~/.docker/config.json
COPY docker-to-ghcr.sh /usr/local/bin
COPY install-dependencies.sh /usr/local/bin
COPY install-docker.sh /usr/local/bin
ENTRYPOINT ["docker-to-ghcr.sh"]