COPY instruction different behavior with build server / resin cli


Currently I have several git submodules in my root directory, and want to copy this into the container.

The docker instruction is as the following

COPY dir1/src /usr/dir1/src

Where the submodules lie inside the /dir1/src directory.
However, when I do git push to the resin app remote, the submodule directories exists, but the contents are empty.

However, when I do

sudo resin deploy <app_name> --build .

The COPY instructions work fine and the contents of the git submodules are copied properly.

Does this issue have something to do with the resin build server?

Thank you in advance.

Hello @jalim, that’s because the builder doesn’t support submodules currently, so when you git push you only send the “umbrella” repository, not its submodules, so there are no files under dir1/src. The CLI doesn’t have any idea of git and merely builds what’s locally on the filesystem, hence you’re seeing it working fine.

@dfunckt Thanks, that clarifies what was happening.

If the builder doesn’t support it currently, are there any plans on supporting it?

@jalim, the reasons submodules aren’t supported on the builder are mostly related to how git works and there are no plans that I know of to support it. That said, you can use resin push to replace the git push workflow completely. This command does support submodules and uses the builder and supports some other goodies as well.

@dfunckt Great thanks

@dfunckt Speaking of resin push There are no documentation on this command and currently it stalls on

$ sudo resin push auterion_distro_nuc
Packaging the project source....

Are there any pointers for solving this issue?

@jalim you would see that behaviour if your project source directory is extremely large. At that step resin-cli is packaging all of the files which are in your project directory into a tar archive, to upload to our build servers. How large is your project directory?

Also, sudo is not required for resin push. You can access the documentation for this command with:

➜  ~ resin help push
Usage: push <application>

This command can be used to start a build on the remote cloud builders. The given source directory will be sent to the builder, and the build will proceed. This can be used as a drop-in
replacement for git push to deploy.


	$ resin push myApp
	$ resin push myApp --source <source directory>
	$ resin push myApp -s <source directory>


    --source, -s <source>               The source that should be sent to the resin builder to be built (defaults to the current directory)

@CameronDiver I have been trying to push my repo but for 30 minutes, it is still on the status as below.

Packaging the project source....

My source directory is 4.9MB

The behavior is quite different when I don’t initialize the git submodules in my source directory: It pushes right away

@jalim Is your source directory still 4.9Mb after checking out the submodules?