summaryrefslogtreecommitdiffhomepage
path: root/images/basic
diff options
context:
space:
mode:
Diffstat (limited to 'images/basic')
-rw-r--r--images/basic/alpine/Dockerfile1
-rw-r--r--images/basic/busybox/Dockerfile1
-rw-r--r--images/basic/hostoverlaytest/Dockerfile8
-rw-r--r--images/basic/hostoverlaytest/copy_up_testfile.txt1
-rw-r--r--images/basic/hostoverlaytest/test_copy_up.c88
-rw-r--r--images/basic/hostoverlaytest/test_rewinddir.c78
-rw-r--r--images/basic/httpd/Dockerfile1
-rw-r--r--images/basic/mysql/Dockerfile1
-rw-r--r--images/basic/nginx/Dockerfile1
-rw-r--r--images/basic/python/Dockerfile2
-rw-r--r--images/basic/resolv/Dockerfile1
-rw-r--r--images/basic/ruby/Dockerfile1
-rw-r--r--images/basic/tmpfile/Dockerfile4
-rw-r--r--images/basic/tomcat/Dockerfile1
-rw-r--r--images/basic/ubuntu/Dockerfile1
15 files changed, 0 insertions, 190 deletions
diff --git a/images/basic/alpine/Dockerfile b/images/basic/alpine/Dockerfile
deleted file mode 100644
index 12b26040a..000000000
--- a/images/basic/alpine/Dockerfile
+++ /dev/null
@@ -1 +0,0 @@
-FROM alpine:3.11.5
diff --git a/images/basic/busybox/Dockerfile b/images/basic/busybox/Dockerfile
deleted file mode 100644
index 79b3f683a..000000000
--- a/images/basic/busybox/Dockerfile
+++ /dev/null
@@ -1 +0,0 @@
-FROM busybox:1.31.1
diff --git a/images/basic/hostoverlaytest/Dockerfile b/images/basic/hostoverlaytest/Dockerfile
deleted file mode 100644
index 6cef1a542..000000000
--- a/images/basic/hostoverlaytest/Dockerfile
+++ /dev/null
@@ -1,8 +0,0 @@
-FROM ubuntu:bionic
-
-WORKDIR /root
-COPY . .
-
-RUN apt-get update && apt-get install -y gcc
-RUN gcc -O2 -o test_copy_up test_copy_up.c
-RUN gcc -O2 -o test_rewinddir test_rewinddir.c
diff --git a/images/basic/hostoverlaytest/copy_up_testfile.txt b/images/basic/hostoverlaytest/copy_up_testfile.txt
deleted file mode 100644
index e4188c841..000000000
--- a/images/basic/hostoverlaytest/copy_up_testfile.txt
+++ /dev/null
@@ -1 +0,0 @@
-old data
diff --git a/images/basic/hostoverlaytest/test_copy_up.c b/images/basic/hostoverlaytest/test_copy_up.c
deleted file mode 100644
index 010b261dc..000000000
--- a/images/basic/hostoverlaytest/test_copy_up.c
+++ /dev/null
@@ -1,88 +0,0 @@
-#include <err.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <unistd.h>
-
-int main(int argc, char** argv) {
- const char kTestFilePath[] = "copy_up_testfile.txt";
- const char kOldFileData[] = "old data\n";
- const char kNewFileData[] = "new data\n";
- const size_t kPageSize = sysconf(_SC_PAGE_SIZE);
-
- // Open a file that already exists in a host overlayfs lower layer.
- const int fd_rdonly = open(kTestFilePath, O_RDONLY);
- if (fd_rdonly < 0) {
- err(1, "open(%s, O_RDONLY)", kTestFilePath);
- }
-
- // Check that the file's initial contents are what we expect when read via
- // syscall.
- char oldbuf[sizeof(kOldFileData)] = {};
- ssize_t n = pread(fd_rdonly, oldbuf, sizeof(oldbuf), 0);
- if (n < 0) {
- err(1, "initial pread");
- }
- if (n != strlen(kOldFileData)) {
- errx(1, "short initial pread (%ld/%lu bytes)", n, strlen(kOldFileData));
- }
- if (strcmp(oldbuf, kOldFileData) != 0) {
- errx(1, "initial pread returned wrong data: %s", oldbuf);
- }
-
- // Check that the file's initial contents are what we expect when read via
- // memory mapping.
- void* page = mmap(NULL, kPageSize, PROT_READ, MAP_SHARED, fd_rdonly, 0);
- if (page == MAP_FAILED) {
- err(1, "mmap");
- }
- if (strcmp(page, kOldFileData) != 0) {
- errx(1, "mapping contains wrong initial data: %s", (const char*)page);
- }
-
- // Open the same file writably, causing host overlayfs to copy it up, and
- // replace its contents.
- const int fd_rdwr = open(kTestFilePath, O_RDWR);
- if (fd_rdwr < 0) {
- err(1, "open(%s, O_RDWR)", kTestFilePath);
- }
- n = write(fd_rdwr, kNewFileData, strlen(kNewFileData));
- if (n < 0) {
- err(1, "write");
- }
- if (n != strlen(kNewFileData)) {
- errx(1, "short write (%ld/%lu bytes)", n, strlen(kNewFileData));
- }
- if (ftruncate(fd_rdwr, strlen(kNewFileData)) < 0) {
- err(1, "truncate");
- }
-
- int failed = 0;
-
- // Check that syscalls on the old FD return updated contents. (Before Linux
- // 4.18, this requires that runsc use a post-copy-up FD to service the read.)
- char newbuf[sizeof(kNewFileData)] = {};
- n = pread(fd_rdonly, newbuf, sizeof(newbuf), 0);
- if (n < 0) {
- err(1, "final pread");
- }
- if (n != strlen(kNewFileData)) {
- warnx("short final pread (%ld/%lu bytes)", n, strlen(kNewFileData));
- failed = 1;
- } else if (strcmp(newbuf, kNewFileData) != 0) {
- warnx("final pread returned wrong data: %s", newbuf);
- failed = 1;
- }
-
- // Check that the memory mapping of the old FD has been updated. (Linux
- // overlayfs does not do this, so regardless of kernel version this requires
- // that runsc replace existing memory mappings with mappings of a
- // post-copy-up FD.)
- if (strcmp(page, kNewFileData) != 0) {
- warnx("mapping contains wrong final data: %s", (const char*)page);
- failed = 1;
- }
-
- return failed;
-}
diff --git a/images/basic/hostoverlaytest/test_rewinddir.c b/images/basic/hostoverlaytest/test_rewinddir.c
deleted file mode 100644
index f1a4085e1..000000000
--- a/images/basic/hostoverlaytest/test_rewinddir.c
+++ /dev/null
@@ -1,78 +0,0 @@
-#include <dirent.h>
-#include <err.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
-int main(int argc, char** argv) {
- const char kDirPath[] = "rewinddir_test_dir";
- const char kFileBasename[] = "rewinddir_test_file";
-
- // Create the test directory.
- if (mkdir(kDirPath, 0755) < 0) {
- err(1, "mkdir(%s)", kDirPath);
- }
-
- // The test directory should initially be empty.
- DIR* dir = opendir(kDirPath);
- if (!dir) {
- err(1, "opendir(%s)", kDirPath);
- }
- int failed = 0;
- while (1) {
- errno = 0;
- struct dirent* d = readdir(dir);
- if (!d) {
- if (errno != 0) {
- err(1, "readdir");
- }
- break;
- }
- if (strcmp(d->d_name, ".") != 0 && strcmp(d->d_name, "..") != 0) {
- warnx("unexpected file %s in new directory", d->d_name);
- failed = 1;
- }
- }
-
- // Create a file in the test directory.
- char* file_path = malloc(strlen(kDirPath) + 1 + strlen(kFileBasename));
- if (!file_path) {
- errx(1, "malloc");
- }
- strcpy(file_path, kDirPath);
- file_path[strlen(kDirPath)] = '/';
- strcpy(file_path + strlen(kDirPath) + 1, kFileBasename);
- if (mknod(file_path, 0644, 0) < 0) {
- err(1, "mknod(%s)", file_path);
- }
-
- // After rewinddir(), re-reading the directory stream should yield the new
- // file.
- rewinddir(dir);
- size_t found_file = 0;
- while (1) {
- errno = 0;
- struct dirent* d = readdir(dir);
- if (!d) {
- if (errno != 0) {
- err(1, "readdir");
- }
- break;
- }
- if (strcmp(d->d_name, kFileBasename) == 0) {
- found_file++;
- } else if (strcmp(d->d_name, ".") != 0 && strcmp(d->d_name, "..") != 0) {
- warnx("unexpected file %s in new directory", d->d_name);
- failed = 1;
- }
- }
- if (found_file != 1) {
- warnx("readdir returned file %s %zu times, wanted 1", kFileBasename,
- found_file);
- failed = 1;
- }
-
- return failed;
-}
diff --git a/images/basic/httpd/Dockerfile b/images/basic/httpd/Dockerfile
deleted file mode 100644
index 83bc0ed88..000000000
--- a/images/basic/httpd/Dockerfile
+++ /dev/null
@@ -1 +0,0 @@
-FROM httpd:2.4.43
diff --git a/images/basic/mysql/Dockerfile b/images/basic/mysql/Dockerfile
deleted file mode 100644
index 95da9c48d..000000000
--- a/images/basic/mysql/Dockerfile
+++ /dev/null
@@ -1 +0,0 @@
-FROM mysql:8.0.19
diff --git a/images/basic/nginx/Dockerfile b/images/basic/nginx/Dockerfile
deleted file mode 100644
index af2e62526..000000000
--- a/images/basic/nginx/Dockerfile
+++ /dev/null
@@ -1 +0,0 @@
-FROM nginx:1.17.9
diff --git a/images/basic/python/Dockerfile b/images/basic/python/Dockerfile
deleted file mode 100644
index acf07cca9..000000000
--- a/images/basic/python/Dockerfile
+++ /dev/null
@@ -1,2 +0,0 @@
-FROM python:3
-ENTRYPOINT ["python", "-m", "http.server", "8080"]
diff --git a/images/basic/resolv/Dockerfile b/images/basic/resolv/Dockerfile
deleted file mode 100644
index 13665bdaf..000000000
--- a/images/basic/resolv/Dockerfile
+++ /dev/null
@@ -1 +0,0 @@
-FROM k8s.gcr.io/busybox:latest
diff --git a/images/basic/ruby/Dockerfile b/images/basic/ruby/Dockerfile
deleted file mode 100644
index d290418fb..000000000
--- a/images/basic/ruby/Dockerfile
+++ /dev/null
@@ -1 +0,0 @@
-FROM ruby:2.7.1
diff --git a/images/basic/tmpfile/Dockerfile b/images/basic/tmpfile/Dockerfile
deleted file mode 100644
index e3816c8cb..000000000
--- a/images/basic/tmpfile/Dockerfile
+++ /dev/null
@@ -1,4 +0,0 @@
-# Create file under /tmp to ensure files inside '/tmp' are not overridden.
-FROM alpine:3.11.5
-RUN mkdir -p /tmp/foo \
- && echo 123 > /tmp/foo/file.txt
diff --git a/images/basic/tomcat/Dockerfile b/images/basic/tomcat/Dockerfile
deleted file mode 100644
index c7db39a36..000000000
--- a/images/basic/tomcat/Dockerfile
+++ /dev/null
@@ -1 +0,0 @@
-FROM tomcat:8.0
diff --git a/images/basic/ubuntu/Dockerfile b/images/basic/ubuntu/Dockerfile
deleted file mode 100644
index 331b71343..000000000
--- a/images/basic/ubuntu/Dockerfile
+++ /dev/null
@@ -1 +0,0 @@
-FROM ubuntu:trusty