Skip to content

Commit

Permalink
updated fileserver directory name (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
zackbradys authored Apr 5, 2024
1 parent f6f2275 commit 16eea6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN make build
RUN echo "hauler:x:1001:1001::/home:" > /etc/passwd \
&& echo "hauler:x:1001:hauler" > /etc/group \
&& mkdir /store \
&& mkdir /store-files \
&& mkdir /fileserver \
&& mkdir /registry

FROM scratch
Expand All @@ -19,7 +19,7 @@ COPY --from=builder --chown=hauler:hauler /home/. /home
COPY --from=builder --chown=hauler:hauler /tmp/. /tmp
COPY --from=builder --chown=hauler:hauler /store/. /store
COPY --from=builder --chown=hauler:hauler /registry/. /registry
COPY --from=builder --chown=hauler:hauler /store-files/. /store-files
COPY --from=builder --chown=hauler:hauler /fileserver/. /fileserver
COPY --from=builder --chown=hauler:hauler /build/bin/hauler /
USER hauler
ENTRYPOINT [ "/hauler" ]
12 changes: 6 additions & 6 deletions cmd/hauler/cli/store/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func ServeRegistryCmd(ctx context.Context, o *ServeRegistryOpts, s *store.Layout
if err != nil {
return err
}

if err = r.ListenAndServe(); err != nil {
return err
}
Expand All @@ -79,8 +79,8 @@ func ServeRegistryCmd(ctx context.Context, o *ServeRegistryOpts, s *store.Layout
type ServeFilesOpts struct {
*RootOpts

Port int
RootDir string
Port int
RootDir string

storedir string
}
Expand All @@ -89,7 +89,7 @@ func (o *ServeFilesOpts) AddFlags(cmd *cobra.Command) {
f := cmd.Flags()

f.IntVarP(&o.Port, "port", "p", 8080, "Port to listen on.")
f.StringVar(&o.RootDir, "directory", "store-files", "Directory to use for backend. Defaults to $PWD/store-files")
f.StringVar(&o.RootDir, "directory", "fileserver", "Directory to use for backend. Defaults to $PWD/fileserver")
}

func ServeFilesCmd(ctx context.Context, o *ServeFilesOpts, s *store.Layout) error {
Expand All @@ -100,7 +100,7 @@ func ServeFilesCmd(ctx context.Context, o *ServeFilesOpts, s *store.Layout) erro
if err := CopyCmd(ctx, opts, s, "dir://"+o.RootDir); err != nil {
return err
}

cfg := server.FileConfig{
Root: o.RootDir,
Port: o.Port,
Expand All @@ -110,7 +110,7 @@ func ServeFilesCmd(ctx context.Context, o *ServeFilesOpts, s *store.Layout) erro
if err != nil {
return err
}

l.Infof("starting file server on port [%d]", o.Port)
if err := f.ListenAndServe(); err != nil {
return err
Expand Down

0 comments on commit 16eea6a

Please sign in to comment.