local.e2e: Reduce number of test images

Signed-off-by: Chris Crone <christopher.crone@docker.com>
This commit is contained in:
Chris Crone 2021-04-13 15:11:14 +02:00 committed by Guillaume Tardif
parent 6941445868
commit c0e5fbba99
16 changed files with 28 additions and 28 deletions

View File

@ -1,9 +1,9 @@
services: services:
simple: simple:
image: busybox:1.31.0-uclibc image: alpine
command: sh -c "sleep 5" command: sh -c "sleep 5"
another: another:
image: busybox:1.31.0-uclibc image: alpine
command: sh -c "sleep 0.1 && echo world && /bin/false" command: sh -c "sleep 0.1 && echo world && /bin/false"
deploy: deploy:
restart_policy: restart_policy:

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM nginx FROM nginx:alpine
ARG FOO ARG FOO
LABEL FOO=$FOO LABEL FOO=$FOO

View File

@ -12,6 +12,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM nginx FROM nginx:alpine
COPY static2 /usr/share/nginx/html COPY static2 /usr/share/nginx/html

View File

@ -1,7 +1,7 @@
services: services:
should_fail: should_fail:
image: busybox:1.27.2 image: alpine
command: ls /does_not_exist command: ls /does_not_exist
sleep: # will be killed sleep: # will be killed
image: busybox:1.27.2 image: alpine
command: ping localhost command: ping localhost

View File

@ -1,13 +1,13 @@
services: services:
service: service:
image: busybox image: alpine
command: top command: top
ipc: "service:shareable" ipc: "service:shareable"
container: container:
image: busybox image: alpine
command: top command: top
ipc: "container:ipc_mode_container" ipc: "container:ipc_mode_container"
shareable: shareable:
image: busybox image: alpine
command: top command: top
ipc: shareable ipc: shareable

View File

@ -1,7 +1,7 @@
services: services:
ping: ping:
image: busybox:1.27.2 image: alpine
command: ping localhost -c 1 command: ping localhost -c 1
hello: hello:
image: busybox:1.31.0-uclibc image: alpine
command: echo hello command: echo hello

View File

@ -1,6 +1,6 @@
services: services:
mydb: mydb:
image: mysql image: mariadb
network_mode: "service:db" network_mode: "service:db"
environment: environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes - MYSQL_ALLOW_EMPTY_PASSWORD=yes

View File

@ -1,4 +1,4 @@
services: services:
restart: restart:
image: busybox image: alpine
command: ash -c "if [[ -f /tmp/restart.lock ]] ; then sleep infinity; else touch /tmp/restart.lock; fi" command: ash -c "if [[ -f /tmp/restart.lock ]] ; then sleep infinity; else touch /tmp/restart.lock; fi"

View File

@ -8,13 +8,13 @@ services:
networks: networks:
- backnet - backnet
db: db:
image: nginx image: nginx:alpine
networks: networks:
- backnet - backnet
volumes: volumes:
- data:/test - data:/test
front: front:
image: nginx image: nginx:alpine
networks: networks:
- frontnet - frontnet
networks: networks:

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM nginx FROM nginx:alpine
ARG FOO ARG FOO
LABEL FOO=$FOO LABEL FOO=$FOO

View File

@ -1,7 +1,7 @@
services: services:
simple: simple:
image: busybox:1.27.2 image: alpine
command: top command: top
another: another:
image: busybox:1.31.0-uclibc image: alpine
command: top command: top

View File

@ -1,5 +1,5 @@
services: services:
simple: simple:
image: nginx image: nginx:alpine
another: another:
image: nginx image: nginx:alpine

View File

@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM nginx FROM nginx:alpine

View File

@ -1,4 +1,4 @@
services: services:
simple: simple:
image: nginx image: nginx:alpine
wrongField: test wrongField: test

View File

@ -32,7 +32,7 @@ func TestIPC(t *testing.T) {
const projectName = "ipc_e2e" const projectName = "ipc_e2e"
var cid string var cid string
t.Run("create ipc mode container", func(t *testing.T) { t.Run("create ipc mode container", func(t *testing.T) {
res := c.RunDockerCmd("run", "-d", "--rm", "--ipc=shareable", "--name", "ipc_mode_container", "busybox", "top") res := c.RunDockerCmd("run", "-d", "--rm", "--ipc=shareable", "--name", "ipc_mode_container", "alpine", "top")
cid = strings.Trim(res.Stdout(), "\n") cid = strings.Trim(res.Stdout(), "\n")
}) })

View File

@ -53,7 +53,7 @@ func TestLocalBackendRun(t *testing.T) {
t.Run("run", func(t *testing.T) { t.Run("run", func(t *testing.T) {
t.Parallel() t.Parallel()
res := c.RunDockerCmd("run", "-d", "nginx") res := c.RunDockerCmd("run", "-d", "nginx:alpine")
containerName := strings.TrimSpace(res.Combined()) containerName := strings.TrimSpace(res.Combined())
t.Cleanup(func() { t.Cleanup(func() {
_ = c.RunDockerOrExitError("rm", "-f", containerName) _ = c.RunDockerOrExitError("rm", "-f", containerName)
@ -64,7 +64,7 @@ func TestLocalBackendRun(t *testing.T) {
t.Run("run rm", func(t *testing.T) { t.Run("run rm", func(t *testing.T) {
t.Parallel() t.Parallel()
res := c.RunDockerCmd("run", "--rm", "-d", "nginx") res := c.RunDockerCmd("run", "--rm", "-d", "nginx:alpine")
containerName := strings.TrimSpace(res.Combined()) containerName := strings.TrimSpace(res.Combined())
t.Cleanup(func() { t.Cleanup(func() {
_ = c.RunDockerOrExitError("rm", "-f", containerName) _ = c.RunDockerOrExitError("rm", "-f", containerName)
@ -81,7 +81,7 @@ func TestLocalBackendRun(t *testing.T) {
}) })
t.Run("run with ports", func(t *testing.T) { t.Run("run with ports", func(t *testing.T) {
res := c.RunDockerCmd("run", "-d", "-p", "85:80", "nginx") res := c.RunDockerCmd("run", "-d", "-p", "85:80", "nginx:alpine")
containerName := strings.TrimSpace(res.Combined()) containerName := strings.TrimSpace(res.Combined())
t.Cleanup(func() { t.Cleanup(func() {
_ = c.RunDockerOrExitError("rm", "-f", containerName) _ = c.RunDockerOrExitError("rm", "-f", containerName)
@ -101,7 +101,7 @@ func TestLocalBackendRun(t *testing.T) {
fields := strings.Fields(line) fields := strings.Fields(line)
if fields[0] == nginxID { if fields[0] == nginxID {
nginxFound = true nginxFound = true
assert.Equal(t, fields[1], "nginx", res.Combined()) assert.Equal(t, fields[1], "nginx:alpine", res.Combined())
assert.Equal(t, fields[2], "/docker-entrypoint.sh", res.Combined()) assert.Equal(t, fields[2], "/docker-entrypoint.sh", res.Combined())
assert.Equal(t, fields[len(fields)-1], "0.0.0.0:85->80/tcp", res.Combined()) assert.Equal(t, fields[len(fields)-1], "0.0.0.0:85->80/tcp", res.Combined())
} }
@ -109,7 +109,7 @@ func TestLocalBackendRun(t *testing.T) {
assert.Assert(t, nginxFound, res.Stdout()) assert.Assert(t, nginxFound, res.Stdout())
res = c.RunDockerCmd("ps", "--format", "json") res = c.RunDockerCmd("ps", "--format", "json")
res.Assert(t, icmd.Expected{Out: `"Image":"nginx","Status":"Up Less than a second","Command":"/docker-entrypoint.sh nginx -g 'daemon off;'","Ports":["0.0.0.0:85->80/tcp"`}) res.Assert(t, icmd.Expected{Out: `"Image":"nginx:alpine","Status":"Up Less than a second","Command":"/docker-entrypoint.sh nginx -g 'daemon off;'","Ports":["0.0.0.0:85->80/tcp"`})
res = c.RunDockerCmd("ps", "--quiet") res = c.RunDockerCmd("ps", "--quiet")
res.Assert(t, icmd.Expected{Out: nginxID + "\n"}) res.Assert(t, icmd.Expected{Out: nginxID + "\n"})