Skip to content

Commit

Permalink
Scope the tar file name more tightly
Browse files Browse the repository at this point in the history
Signed-off-by: Dominic Ayre <domayre@outlook.com>
  • Loading branch information
DomAyre committed Mar 28, 2024
1 parent 2352140 commit d79678f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
Binary file added cmd/dmverity-vhd/dmverity-vhd
Binary file not shown.
4 changes: 2 additions & 2 deletions cmd/dmverity-vhd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func fetchImageLayers(ctx *cli.Context) (layers []v1.Layer, err error) {
}
defer imageTarReader.Close()

tarFile, err := os.CreateTemp("", "image-tar")
tarFile, err := os.CreateTemp("", "dmverity-vhd-image-tar")
if err != nil {
return nil, fmt.Errorf("failed to create tar file: %w", err)
}
Expand Down Expand Up @@ -343,7 +343,7 @@ var rootHashVHDCommand = cli.Command{
}

for _, file := range files {
if strings.HasPrefix(file.Name(), "image-tar") {
if strings.HasPrefix(file.Name(), "dmverity-vhd-image-tar") {
err := os.Remove(filepath.Join(tempDir, file.Name()))
if err != nil {
return fmt.Errorf("failed to remove file %s: %w", file.Name(), err)
Expand Down
30 changes: 30 additions & 0 deletions docker-ubuntu.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Use Ubuntu as the base image
FROM ubuntu:latest

# Avoid prompts from apt
ENV DEBIAN_FRONTEND=noninteractive

# Update apt and install dependencies
RUN apt-get update && apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common

# Add Docker’s official GPG key
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -

# Add the Docker apt repository
RUN add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"

# Install Docker CE
RUN apt-get update && apt-get install -y docker-ce docker-ce-cli containerd.io

# Verify installation
RUN docker --version

# Set default command
CMD ["bash"]

0 comments on commit d79678f

Please sign in to comment.