Skip to content

Commit 41a0040

Browse files
authored
Merge pull request #203 from crazy-max/update-troubleshooting
Update troubleshooting notes
2 parents 41b2c88 + 5f6cd6b commit 41a0040

File tree

2 files changed

+115
-5
lines changed

2 files changed

+115
-5
lines changed

TROUBLESHOOTING.md

+110-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,114 @@
11
# Troubleshooting
22

3-
## Errors on pushing to registry
3+
* [`auto-push is currently not implemented for docker driver`](#auto-push-is-currently-not-implemented-for-docker-driver)
4+
* [Cannot push to a registry](#cannot-push-to-a-registry)
5+
6+
## `auto-push is currently not implemented for docker driver`
7+
8+
If you're using the default builder (which uses the docker driver) without using our `setup-buildx-action`, you may
9+
encounter this error message if you try to push your image:
10+
11+
```
12+
Run docker/build-push-action@v2
13+
📣 Buildx version: 0.4.2
14+
🏃 Starting build...
15+
/usr/bin/docker buildx build --tag localhost:5000/name/app:latest --iidfile /tmp/docker-build-push-eYl8PB/iidfile --file ./test/Dockerfile --push ./test
16+
auto-push is currently not implemented for docker driver
17+
Error: buildx call failed with: auto-push is currently not implemented for docker driver
18+
```
19+
20+
While waiting for an implementation to be done on buildx/buildkit, you have the following possibilities
21+
to solve this atm:
22+
23+
### With `docker-container` driver and `setup-buildx`
24+
25+
> Recommended solution
26+
27+
```yaml
28+
jobs:
29+
build:
30+
-
31+
name: Checkout
32+
uses: actions/checkout@v2
33+
-
34+
name: Set up Docker Buildx
35+
uses: docker/setup-buildx-action@v1
36+
-
37+
name: Login
38+
uses: docker/login-action@v1
39+
with:
40+
registry: ${{ env.REGISTRY }}
41+
username: ${{ env.USER }}
42+
password: ${{ secrets.PASSWORD }}
43+
-
44+
name: Build and push
45+
uses: docker/build-push-action@v2
46+
with:
47+
context: .
48+
tags: ${{ env.REGISTRY }}/myapp:latest
49+
push: true
50+
```
51+
52+
### With `docker` driver
53+
54+
```yaml
55+
jobs:
56+
build:
57+
-
58+
name: Checkout
59+
uses: actions/checkout@v2
60+
-
61+
name: Login
62+
uses: docker/login-action@v1
63+
with:
64+
registry: ${{ env.REGISTRY }}
65+
username: ${{ env.USER }}
66+
password: ${{ secrets.PASSWORD }}
67+
-
68+
name: Build
69+
uses: docker/build-push-action@v2
70+
with:
71+
context: .
72+
tags: ${{ env.REGISTRY }}/myapp:latest
73+
load: true
74+
-
75+
name: Push
76+
run: docker push ${{ env.REGISTRY }}/myapp:latest
77+
```
78+
79+
### With `docker` driver and `setup-buildx`
80+
81+
```yaml
82+
jobs:
83+
build:
84+
-
85+
name: Checkout
86+
uses: actions/checkout@v2
87+
-
88+
name: Set up Docker Buildx
89+
uses: docker/setup-buildx-action@v1
90+
with:
91+
driver: docker
92+
-
93+
name: Login
94+
uses: docker/login-action@v1
95+
with:
96+
registry: ${{ env.REGISTRY }}
97+
username: ${{ env.USER }}
98+
password: ${{ secrets.PASSWORD }}
99+
-
100+
name: Build
101+
uses: docker/build-push-action@v2
102+
with:
103+
context: .
104+
tags: ${{ env.REGISTRY }}/myapp:latest
105+
load: true
106+
-
107+
name: Push
108+
run: docker push ${{ env.REGISTRY }}/myapp:latest
109+
```
110+
111+
## Cannot push to a registry
4112

5113
While pushing to a registry, you may encounter these kinds of issues:
6114

@@ -38,7 +146,7 @@ jobs:
38146
containerd:
39147
runs-on: ubuntu-latest
40148
steps:
41-
-
149+
-
42150
name: Checkout
43151
uses: actions/checkout@v2
44152
-

__tests__/buildx.test.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,11 @@ describe('parseVersion', () => {
117117
});
118118

119119
describe('getSecret', () => {
120-
it('writes correct secret content', async () => {
121-
const key = 'MY_KEY';
122-
const secret = 'c3RyaW5nLXdpdGgtZXF1YWxzCg==';
120+
test.each([
121+
['A_SECRET', 'abcdef0123456789'],
122+
['GIT_AUTH_TOKEN', 'abcdefghijklmno=0123456789'],
123+
['MY_KEY', 'c3RyaW5nLXdpdGgtZXF1YWxzCg==']
124+
])('given %p key and %p secret', async (key, secret) => {
123125
const secretArgs = await buildx.getSecret(`${key}=${secret}`);
124126
console.log(`secretArgs: ${secretArgs}`);
125127
expect(secretArgs).toEqual(`id=${key},src=${tmpNameSync}`);

0 commit comments

Comments
 (0)